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

Unified Diff: pkg/compiler/lib/src/inferrer/inferrer_visitor.dart

Issue 2425933002: Revert "Change TypeInference to handle super calls as direct invocations." and "Optimize needNoSuch… (Closed)
Patch Set: Created 4 years, 2 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: pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
index d011dc0d1977cf619e93499e794b3dd9fa01cbf7..bff02bd231a2291c9df27330cedaf468f1e50601 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
@@ -958,6 +958,13 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
}
}
+ T _superType;
+ T get superType {
+ if (_superType != null) return _superType;
+ return _superType =
+ types.nonNullExact(outermostElement.enclosingClass.superclass);
+ }
+
@override
T visitThisGet(Identifier node, _) {
return thisType;
@@ -967,7 +974,7 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
if (node.isThis()) {
return thisType;
} else if (node.isSuper()) {
- return internalError(node, 'Unexpected expression $node.');
+ return superType;
} else {
Element element = elements[node];
if (Elements.isLocal(element)) {
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698