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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.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
Index: pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
index 5fcad876a63aadb97472b213aaa96de2b656e27a..652f955616c3cd42080d9f29164136acc063020b 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
@@ -154,10 +154,14 @@ abstract class TypeInferenceEngineImpl extends TypeInferenceEngine {
var typeInferrer = getFieldTypeInferrer(field);
var type = getFieldDeclaredType(field);
if (type == null && strongMode) {
+ typeInferrer.isImmediatelyEvident = true;
var inferredType = fieldNode.isImmediatelyEvident
? typeInferrer.inferDeclarationType(
typeInferrer.inferFieldTopLevel(field, type, true))
: const DynamicType();
+ if (!typeInferrer.isImmediatelyEvident) {
+ inferredType = const DynamicType();
+ }
instrumentation?.record(
Uri.parse(typeInferrer.uri),
getFieldOffset(field),

Powered by Google App Engine
This is Rietveld 408576698