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

Unified Diff: pkg/analyzer/test/generated/type_system_test.dart

Issue 2699053002: treat void as a top type, analyzer fix for #28763
Patch Set: Created 3 years, 10 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/analyzer/test/generated/type_system_test.dart
diff --git a/pkg/analyzer/test/generated/type_system_test.dart b/pkg/analyzer/test/generated/type_system_test.dart
index 0f6ea84d5fb39b618214677aebec14eb79bb185a..a0844fd73111a9deb6d2e99d083bc2eb57c2f262 100644
--- a/pkg/analyzer/test/generated/type_system_test.dart
+++ b/pkg/analyzer/test/generated/type_system_test.dart
@@ -271,7 +271,12 @@ abstract class LeastUpperBoundTestBase extends BoundTestBase {
}
void test_dynamic_void() {
- _checkLeastUpperBound(dynamicType, voidType, dynamicType);
+ expect(typeSystem.isSubtypeOf(dynamicType, voidType), isTrue);
+ expect(typeSystem.isSubtypeOf(voidType, dynamicType), isTrue);
+ // TODO(jmesserly): this is sensitive to order, see
+ // https://github.com/dart-lang/sdk/issues/28513
+ expect(typeSystem.getLeastUpperBound(dynamicType, voidType), dynamicType);
+ expect(typeSystem.getLeastUpperBound(voidType, dynamicType), voidType);
}
void test_functionsDifferentRequiredArity() {
@@ -1199,7 +1204,14 @@ class StrongGreatestLowerBoundTest extends BoundTestBase {
}
void test_dynamic_void() {
- _checkGreatestLowerBound(dynamicType, voidType, voidType);
+ expect(typeSystem.isSubtypeOf(dynamicType, voidType), isTrue);
+ expect(typeSystem.isSubtypeOf(voidType, dynamicType), isTrue);
+ // TODO(jmesserly): this is sensitive to order, see
+ // https://github.com/dart-lang/sdk/issues/28513
+ expect(strongTypeSystem.getGreatestLowerBound(dynamicType, voidType),
+ voidType);
+ expect(strongTypeSystem.getGreatestLowerBound(voidType, dynamicType),
+ dynamicType);
}
void test_functionsDifferentNamedTakeUnion() {
« no previous file with comments | « pkg/analyzer/lib/src/generated/type_system.dart ('k') | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698