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

Unified Diff: pkg/front_end/test/fasta/type_inference/type_schema_elimination_test.dart

Issue 2965123002: Fix greatest/least closure computation when there are multiple `?`s. (Closed)
Patch Set: Created 3 years, 5 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/test/fasta/type_inference/type_schema_elimination_test.dart
diff --git a/pkg/front_end/test/fasta/type_inference/type_schema_elimination_test.dart b/pkg/front_end/test/fasta/type_inference/type_schema_elimination_test.dart
index 36fb52e77e5715b7355028bf46ce7721aee63221..5a533af1a0effcd0806dc70f104565f3b899ef67 100644
--- a/pkg/front_end/test/fasta/type_inference/type_schema_elimination_test.dart
+++ b/pkg/front_end/test/fasta/type_inference/type_schema_elimination_test.dart
@@ -63,6 +63,18 @@ class TypeSchemaEliminationTest {
'dart.core::List<dynamic>');
}
+ void test_greatestClosure_function_multipleUnknown() {
+ expect(
+ greatestClosure(new FunctionType(
+ [unknownType, unknownType], unknownType,
+ namedParameters: [
+ new NamedType('a', unknownType),
+ new NamedType('b', unknownType)
+ ])).toString(),
+ '(dart.core::Null, dart.core::Null, {a: dart.core::Null, '
+ 'b: dart.core::Null}) → dynamic');
+ }
+
void test_greatestClosure_simple() {
expect(greatestClosure(unknownType).toString(), 'dynamic');
}
@@ -95,6 +107,16 @@ class TypeSchemaEliminationTest {
'dart.core::List<dart.core::Null>');
}
+ void test_leastClosure_function_multipleUnknown() {
+ expect(
+ leastClosure(new FunctionType([unknownType, unknownType], unknownType,
+ namedParameters: [
+ new NamedType('a', unknownType),
+ new NamedType('b', unknownType)
+ ])).toString(),
+ '(dynamic, dynamic, {a: dynamic, b: dynamic}) → dart.core::Null');
+ }
+
void test_leastClosure_simple() {
expect(leastClosure(unknownType).toString(), 'dart.core::Null');
}

Powered by Google App Engine
This is Rietveld 408576698