| Index: tests/lib/mirrors/relation_subtype_test.dart
|
| diff --git a/tests/lib/mirrors/relation_subtype_test.dart b/tests/lib/mirrors/relation_subtype_test.dart
|
| index b59e7e3e37e068a562ea49690cb6f3f409d32e8e..79160f28977a5bb36dfe3d7ef501d92b28c3d28e 100644
|
| --- a/tests/lib/mirrors/relation_subtype_test.dart
|
| +++ b/tests/lib/mirrors/relation_subtype_test.dart
|
| @@ -10,7 +10,9 @@ import "dart:mirrors";
|
| import "package:expect/expect.dart";
|
|
|
| class Superclass {}
|
| +
|
| class Subclass1 extends Superclass {}
|
| +
|
| class Subclass2 extends Superclass {}
|
|
|
| typedef bool NumberPredicate(num x);
|
| @@ -22,7 +24,9 @@ typedef int IntegerGenerator();
|
| typedef double DoubleGenerator();
|
|
|
| class A<T> {}
|
| +
|
| class B<T> extends A<T> {}
|
| +
|
| class C<T extends num> {}
|
|
|
| test(MirrorSystem mirrors) {
|
| @@ -62,7 +66,7 @@ test(MirrorSystem mirrors) {
|
|
|
| Expect.isTrue(Nul.isSubtypeOf(Obj));
|
| Expect.isFalse(Obj.isSubtypeOf(Nul));
|
| - Expect.isTrue(Nul.isSubtypeOf(Super)); // Null type is bottom type.
|
| + Expect.isTrue(Nul.isSubtypeOf(Super)); // Null type is bottom type.
|
| Expect.isFalse(Super.isSubtypeOf(Nul));
|
|
|
| // Function typedef - argument type.
|
| @@ -93,7 +97,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];
|
| @@ -120,7 +123,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;
|
| @@ -148,7 +150,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;
|
| @@ -175,7 +176,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));
|
| @@ -184,7 +184,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));
|
| @@ -193,7 +192,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;
|
| @@ -212,12 +210,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));
|
|
|