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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart

Issue 16188008: Handle fields/getter of mixed-in classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync and fix wording in comment Created 7 years, 6 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
index 449e4420bda94e9d8a6bc0bb1f99de9a6e2e78e1..ee5ccd5f1f8aef259b0a62624388cf0f9db9eb25 100644
--- a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
@@ -2057,9 +2057,8 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
}
}
} else {
- // node is a field of not(this)
- assert(node.receiver != null);
-
+ // node is a field/getter which doesn't belong to the current class or
+ // the field/getter of a mixed-in class
ConcreteType result = inferrer.emptyConcreteType;
void augmentResult(ClassElement baseReceiverType, Element member) {
if (member.isField()) {
@@ -2074,7 +2073,9 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
// since this is a get we ignore non-fields
}
- ConcreteType receiverType = analyze(node.receiver);
+ ConcreteType receiverType = node.receiver != null
+ ? analyze(node.receiver)
+ : environment.lookupTypeOfThis();
if (receiverType.isUnknown()) {
SourceString name = node.selector.asIdentifier().source;
inferrer.addDynamicCaller(name, currentMethodOrField);
« no previous file with comments | « no previous file | tests/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698