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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.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_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 2539c8d934033bbc8e7ca2e54f8dd6bd2851458e..c026952fad1fc24cceffbb56dab6e140f93f1e35 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -192,6 +192,12 @@ abstract class TypeInferrerImpl extends TypeInferrer {
/// inside a closure.
ClosureContext closureContext;
+ /// When performing top level inference, this boolean is set to `false` if we
+ /// discover that the type of the object is not immediately evident.
+ ///
+ /// Not used when performing local inference.
+ bool isImmediatelyEvident = true;
+
TypeInferrerImpl(
TypeInferenceEngineImpl engine, this.uri, this.listener, bool topLevel)
: coreTypes = engine.coreTypes,
@@ -451,6 +457,12 @@ abstract class TypeInferrerImpl extends TypeInferrer {
/// the statement type and calls the appropriate specialized "infer" method.
void inferStatement(Statement statement);
+ void recordNotImmediatelyEvident(int fileOffset) {
+ assert(isTopLevel);
+ isImmediatelyEvident = false;
+ // TODO(paulberry): report an error.
+ }
+
DartType wrapFutureOrType(DartType type) {
if (type is InterfaceType &&
identical(type.classNode, coreTypes.futureOrClass)) {
« no previous file with comments | « pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart ('k') | pkg/front_end/test/fasta/kompile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698