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

Unified Diff: pkg/front_end/lib/src/fasta/source/diet_listener.dart

Issue 2962913002: Create an option to disable type inference and type promotion. (Closed)
Patch Set: Created 3 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
Index: pkg/front_end/lib/src/fasta/source/diet_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/diet_listener.dart b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
index 3c8d04174b8e08d7faa8d7bb0346307a94a4f5b6..ec1cd61e1b9835231519b9326ad5932a03de9179 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -10,6 +10,9 @@ import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart'
import 'package:front_end/src/fasta/type_inference/type_inference_listener.dart'
show TypeInferenceListener;
+import 'package:front_end/src/fasta/type_inference/type_inferrer.dart'
+ show TypeInferrerDisabled;
+
import 'package:kernel/ast.dart' show AsyncMarker, Class, InterfaceType;
import 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
@@ -416,8 +419,9 @@ class DietListener extends StackListener {
Class cls = builder.parent.target;
thisType = cls.thisType;
}
- var typeInferrer =
- typeInferenceEngine.createLocalTypeInferrer(uri, listener, thisType);
+ var typeInferrer = library.disableTypeInference
+ ? new TypeInferrerDisabled()
+ : typeInferenceEngine.createLocalTypeInferrer(uri, listener, thisType);
return new BodyBuilder(library, builder, memberScope, formalParameterScope,
hierarchy, coreTypes, currentClass, isInstanceMember, uri, typeInferrer)
..constantExpressionRequired = builder.isConstructor && builder.isConst;
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_target.dart ('k') | pkg/front_end/lib/src/fasta/source/source_library_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698