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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.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
Index: pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
index 89a7f01fedc2c46d0ccb77de95b2d56cfc0d6e08..9300e3ff25ef3b21abb1ba9131f3fdf1ff04c813 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
@@ -392,11 +392,11 @@ class TypeSchemaEnvironment extends TypeEnvironment {
// Otherwise take whatever bound has partial information, e.g. `Iterable<?>`
if (constraint.lower is! UnknownType) {
return grounded
- ? greatestClosure(coreTypes, constraint.lower)
+ ? leastClosure(coreTypes, constraint.lower)
: constraint.lower;
} else {
return grounded
- ? leastClosure(coreTypes, constraint.upper)
+ ? greatestClosure(coreTypes, constraint.upper)
: constraint.upper;
}
}

Powered by Google App Engine
This is Rietveld 408576698