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

Unified Diff: lib/compiler/implementation/resolver.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: 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/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index f9b52968b1ebb131e06e25b3d6c0650ef8b77312..0b4f69e05603052d1ff173e98d0f00506fac5328 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -1547,19 +1547,6 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
return null;
}
- TypeAnnotation getTypeAnnotationFromSend(Send send) {
- if (send.selector.asTypeAnnotation() !== null) {
- return send.selector;
- } else if (send.selector.asSend() !== null) {
- Send selector = send.selector;
- if (selector.receiver.asTypeAnnotation() !== null) {
- return selector.receiver;
- }
- } else {
- compiler.internalError("malformed send in new expression");
- }
- }
-
/**
* Try to resolve the constructor that is referred to by [node].
* Note: this function may return an ErroneousFunctionElement instead of
@@ -1571,7 +1558,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
new ConstructorResolver(compiler, this, node.isConst());
FunctionElement constructor = node.accept(visitor);
// Try to resolve the type that the new-expression constructs.
- TypeAnnotation annotation = getTypeAnnotationFromSend(node.send);
+ TypeAnnotation annotation = node.send.getTypeAnnotation();
if (Element.isInvalid(constructor)) {
// Resolve the type arguments. We cannot create a type and check the
// number of type arguments for this annotation, because we do not know

Powered by Google App Engine
This is Rietveld 408576698