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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart

Issue 2872763002: Change front end type inference algebra to match analyzer. (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_schema_environment.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/type_inference/type_schema_elimination.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart
index f9b856ffd59969aee32d910a8d1b5f3ede5b5ea0..0c96c24d49bf0691e3f661b68227972782dd4303 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart
@@ -46,13 +46,10 @@ DartType leastClosure(CoreTypes coreTypes, DartType schema) =>
class _TypeSchemaEliminationVisitor extends TypeSchemaVisitor<DartType> {
final DartType nullType;
- final DartType objectType;
-
bool isLeastClosure;
_TypeSchemaEliminationVisitor(CoreTypes coreTypes, this.isLeastClosure)
- : nullType = coreTypes.nullClass.rawType,
- objectType = coreTypes.objectClass.rawType;
+ : nullType = coreTypes.nullClass.rawType;
@override
DartType visitFunctionType(FunctionType node) {
@@ -112,7 +109,7 @@ class _TypeSchemaEliminationVisitor extends TypeSchemaVisitor<DartType> {
@override
DartType visitUnknownType(UnknownType node) =>
- isLeastClosure ? nullType : objectType;
+ isLeastClosure ? nullType : const DynamicType();
/// Runs an instance of the visitor on the given [schema] and returns the
/// resulting type. If the schema contains no instances of `?`, the original
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698