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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2914113002: Add some top level type inference rules for property gets. (Closed)
Patch Set: Created 3 years, 7 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 | pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 545ee2768340bc423518a94c4eec87bcdbf5ecda..532f236cdb1a051b091a0d9e9a21a59cd817bd39 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -1160,6 +1160,14 @@ class KernelPropertyGet extends PropertyGet implements KernelExpression {
if (receiverType is InterfaceType) {
interfaceMember = inferrer.classHierarchy
.getInterfaceMember(receiverType.classNode, name);
+ if (inferrer.isTopLevel &&
+ ((interfaceMember is Procedure &&
+ interfaceMember.kind == ProcedureKind.Getter) ||
+ interfaceMember is Field)) {
+ // References to fields and getters can't be relied upon for top level
+ // inference.
+ inferrer.recordNotImmediatelyEvident(fileOffset);
+ }
// Our non-strong golden files currently don't include interface targets,
// so we can't store the interface target without causing tests to fail.
// TODO(paulberry): fix this.
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698