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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java

Issue 578643004: Redefine union-type subtyping to be more permissive. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/UnionTypeImpl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java
index a362f5eb0080a066cfad006528c92c8981764c42..079c58e69bf168ed2cc1fe3db78989ec51f9e7a4 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java
@@ -93,12 +93,12 @@ public class UnionTypeImplTest extends EngineTestCase {
}
}
- // This tests the more strict (less unsound) subtype semantics for union types.
- // It will break if we change to the less strict definition of subtyping.
+ // This tests the less strict (more unsound) subtype semantics for union types.
+ // It will break if we change to the more strict definition of subtyping.
public void test_isMoreSpecificThan_someElementOnLHSIsNotASubtypeOfAnyElementOnRHS() {
- // Unions are not subtypes when some element is not a subtype
- assertFalse(uAB.isMoreSpecificThan(uB));
- assertFalse(uAB.isMoreSpecificThan(typeB));
+ // Unions are subtypes when some element is a subtype
+ assertTrue(uAB.isMoreSpecificThan(uB));
+ assertTrue(uAB.isMoreSpecificThan(typeB));
}
public void test_isMoreSpecificThan_subtypeOfSomeElement() {
@@ -129,12 +129,12 @@ public class UnionTypeImplTest extends EngineTestCase {
}
}
- // This tests the more strict (less unsound) subtype semantics for union types.
- // It will break if we change to the less strict definition of subtyping.
+ // This tests the less strict (more unsound) subtype semantics for union types.
+ // It will break if we change to the more strict definition of subtyping.
public void test_isSubtypeOf_someElementOnLHSIsNotASubtypeOfAnyElementOnRHS() {
- // Unions are not subtypes when some element is not a subtype
- assertFalse(uAB.isSubtypeOf(uB));
- assertFalse(uAB.isSubtypeOf(typeB));
+ // Unions are subtypes when some element is a subtype
+ assertTrue(uAB.isSubtypeOf(uB));
+ assertTrue(uAB.isSubtypeOf(typeB));
}
public void test_isSubtypeOf_subtypeOfSomeElement() {
« no previous file with comments | « editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/UnionTypeImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698