Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10915054: Mark the local for this as used if a constructor call needs type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test and address comments. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index e8517ce475764335c6489bd52a864f9fbc6c4a97..8a2d33a4108cb9ced2661e73ee6a18dee2b61b65 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -328,7 +328,6 @@ class LocalsHandler {
Compiler compiler = builder.compiler;
closureData = compiler.closureToClassMapper.computeClosureToClassMapping(
node, builder.elements);
-
FunctionSignature signature = function.computeSignature(compiler);
signature.forEachParameter((Element element) {
HInstruction parameter = new HParameterValue(element);
@@ -2528,8 +2527,12 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
compiler.cancel('Unimplemented non-matching static call', node: node);
}
- TypeAnnotation annotation = getTypeAnnotationFromSend(node);
- elements.getType(annotation).arguments.forEach((DartType argument) {
+ TypeAnnotation annotation = node.getTypeAnnotation();
+ if (annotation == null) {
+ compiler.internalError("malformed send in new expression");
+ }
+ InterfaceType type = elements.getType(annotation);
+ type.arguments.forEach((DartType argument) {
inputs.add(analyzeTypeArgument(argument, node));
});
@@ -2589,20 +2592,6 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
compiler.internalError(reason, node: node);
}
- // TODO(karlklose): share with resolver.
- TypeAnnotation getTypeAnnotationFromSend(Send send) {
- if (send.selector is TypeAnnotation) {
- return send.selector;
- } else if (send.selector is Send) {
- Send selector = send.selector;
- if (selector.receiver is TypeAnnotation) {
- return selector.receiver;
- }
- } else {
- compiler.internalError("malformed send in new expression");
- }
- }
-
void generateRuntimeError(Node node, String message) {
DartString messageObject = new DartString.literal(message);
HInstruction errorMessage = graph.addConstantString(messageObject, node);

Powered by Google App Engine
This is Rietveld 408576698