Index: tests/lib_strong/mirrors/relation_subtype_test.dart |
diff --git a/tests/lib_strong/mirrors/relation_subtype_test.dart b/tests/lib_strong/mirrors/relation_subtype_test.dart |
index 9504c8cc4ed7bc1b487f8315047b53447d5eeb0b..0ea9a2805ca98140cd2ea6590dae0b43df7c7a94 100644 |
--- a/tests/lib_strong/mirrors/relation_subtype_test.dart |
+++ b/tests/lib_strong/mirrors/relation_subtype_test.dart |
@@ -9,7 +9,9 @@ import "dart:mirrors"; |
import "package:expect/expect.dart"; |
class Superclass {} |
+ |
class Subclass1 extends Superclass {} |
+ |
class Subclass2 extends Superclass {} |
typedef bool NumberPredicate(num x); |
@@ -21,7 +23,9 @@ typedef int IntegerGenerator(); |
typedef double DoubleGenerator(); |
class A<T> {} |
+ |
class B<T> extends A<T> {} |
+ |
class C<T extends num> {} |
test(MirrorSystem mirrors) { |
@@ -57,7 +61,6 @@ test(MirrorSystem mirrors) { |
Expect.isTrue(Super.isSubtypeOf(Obj)); |
Expect.isFalse(Obj.isSubtypeOf(Super)); |
- |
// Function typedef - argument type. |
TypeMirror Func = coreLibrary.declarations[#Function]; |
TypedefMirror NumPred = thisLibrary.declarations[#NumberPredicate]; |
@@ -86,7 +89,6 @@ test(MirrorSystem mirrors) { |
Expect.isTrue(IntPred.isSubtypeOf(Obj)); |
Expect.isTrue(DubPred.isSubtypeOf(Obj)); |
- |
// Function typedef - return type. |
TypedefMirror NumGen = thisLibrary.declarations[#NumberGenerator]; |
TypedefMirror IntGen = thisLibrary.declarations[#IntegerGenerator]; |
@@ -113,7 +115,6 @@ test(MirrorSystem mirrors) { |
Expect.isTrue(IntGen.isSubtypeOf(Obj)); |
Expect.isTrue(DubGen.isSubtypeOf(Obj)); |
- |
// Function - argument type. |
TypeMirror NumPredRef = NumPred.referent; |
TypeMirror IntPredRef = IntPred.referent; |
@@ -141,7 +142,6 @@ test(MirrorSystem mirrors) { |
Expect.isTrue(IntPredRef.isSubtypeOf(Obj)); |
Expect.isTrue(DubPredRef.isSubtypeOf(Obj)); |
- |
// Function - return type. |
TypeMirror NumGenRef = NumGen.referent; |
TypeMirror IntGenRef = IntGen.referent; |
@@ -168,7 +168,6 @@ test(MirrorSystem mirrors) { |
Expect.isTrue(IntGenRef.isSubtypeOf(Obj)); |
Expect.isTrue(DubGenRef.isSubtypeOf(Obj)); |
- |
// Function typedef / function. |
Expect.isTrue(NumPred.isSubtypeOf(NumPredRef)); |
Expect.isTrue(IntPred.isSubtypeOf(IntPredRef)); |
@@ -177,7 +176,6 @@ test(MirrorSystem mirrors) { |
Expect.isTrue(IntPredRef.isSubtypeOf(IntPred)); |
Expect.isTrue(DubPredRef.isSubtypeOf(DubPred)); |
- |
// Function typedef / function. |
Expect.isTrue(NumGen.isSubtypeOf(NumGenRef)); |
Expect.isTrue(IntGen.isSubtypeOf(IntGenRef)); |
@@ -186,7 +184,6 @@ test(MirrorSystem mirrors) { |
Expect.isTrue(IntGenRef.isSubtypeOf(IntGen)); |
Expect.isTrue(DubGenRef.isSubtypeOf(DubGen)); |
- |
// Type variable. |
TypeMirror TFromA = |
(thisLibrary.declarations[#A] as ClassMirror).typeVariables.single; |
@@ -205,12 +202,11 @@ test(MirrorSystem mirrors) { |
Expect.isFalse(TFromB.isSubtypeOf(TFromC)); |
Expect.isFalse(TFromC.isSubtypeOf(TFromA)); |
Expect.isFalse(TFromC.isSubtypeOf(TFromB)); |
- |
+ |
TypeMirror Num = coreLibrary.declarations[#num]; |
Expect.isTrue(TFromC.isSubtypeOf(Num)); |
Expect.isFalse(Num.isSubtypeOf(TFromC)); |
- |
// dynamic & void. |
TypeMirror Dynamic = mirrors.dynamicType; |
Expect.isTrue(Dynamic.isSubtypeOf(Dynamic)); |