OLD | NEW |
(Empty) | |
| 1 library generic_methods_overriding_test; |
| 2 import self as self; |
| 3 import "dart:core" as core; |
| 4 import "../../runtime/reify/interceptors.dart" as int; |
| 5 import "../../runtime/reify/types.dart" as typ; |
| 6 import "./test_base.dart" as tes; |
| 7 import "../../runtime/reify/declarations.dart" as dec; |
| 8 |
| 9 class X extends core::Object implements int::HasRuntimeTypeGetter { |
| 10 constructor •() → void |
| 11 : super core::Object::•() |
| 12 ; |
| 13 get $type() → typ::ReifiedType |
| 14 return new typ::Interface::•(self::$declarations.[](0)); |
| 15 } |
| 16 class Y extends self::X implements int::HasRuntimeTypeGetter { |
| 17 constructor •() → void |
| 18 : super self::X::•() |
| 19 ; |
| 20 get $type() → typ::ReifiedType |
| 21 return new typ::Interface::•(self::$declarations.[](1)); |
| 22 } |
| 23 class C extends core::Object implements int::HasRuntimeTypeGetter { |
| 24 constructor •() → void |
| 25 : super core::Object::•() |
| 26 ; |
| 27 method fun<T extends self::Y>(dynamic t, {core::List<typ::ReifiedType> $typePa
rameters}) → core::String { |
| 28 return "C"; |
| 29 } |
| 30 get $type() → typ::ReifiedType |
| 31 return new typ::Interface::•(self::$declarations.[](2)); |
| 32 } |
| 33 class D extends self::C implements int::HasRuntimeTypeGetter { |
| 34 constructor •() → void |
| 35 : super self::C::•() |
| 36 ; |
| 37 method fun<T extends self::Y>(dynamic t, {core::List<typ::ReifiedType> $typePa
rameters}) → core::String { |
| 38 return "D"; |
| 39 } |
| 40 get $type() → typ::ReifiedType |
| 41 return new typ::Interface::•(self::$declarations.[](3)); |
| 42 } |
| 43 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { |
| 44 dec::init(d, 0, new typ::Interface::•(d.[](17))); |
| 45 dec::init(d, 1, new typ::Interface::•(d.[](0))); |
| 46 dec::init(d, 2, new typ::Interface::•(d.[](17))); |
| 47 dec::init(d, 3, new typ::Interface::•(d.[](2))); |
| 48 dec::init(d, 4, new typ::Interface::•(d.[](17))); |
| 49 dec::init(d, 5, new typ::Interface::•(d.[](17))); |
| 50 dec::init(d, 6, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface:
:•(d.[](19), <dynamic>[new typ::Interface::•(d.[](6))]), new typ::Interface::•(d
.[](20))]); |
| 51 dec::init(d, 7, new typ::Interface::•(d.[](21))); |
| 52 dec::init(d, 8, new typ::Interface::•(d.[](21))); |
| 53 dec::init(d, 9, new typ::Interface::•(d.[](17))); |
| 54 dec::init(d, 10, new typ::Interface::•(d.[](22))); |
| 55 dec::init(d, 11, new typ::Interface::•(d.[](22))); |
| 56 dec::init(d, 12, new typ::Interface::•(d.[](22))); |
| 57 dec::init(d, 13, new typ::Interface::•(d.[](22))); |
| 58 dec::init(d, 14, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface
::•(d.[](23))]); |
| 59 dec::init(d, 15, new typ::Interface::•(d.[](16))); |
| 60 dec::init(d, 16, new typ::Interface::•(d.[](22))); |
| 61 dec::init(d, 17, null); |
| 62 dec::init(d, 19, new typ::Interface::•(d.[](17))); |
| 63 dec::init(d, 20, new typ::Interface::•(d.[](17))); |
| 64 dec::init(d, 21, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface
::•(d.[](19), <dynamic>[new typ::Interface::•(d.[](21))])]); |
| 65 dec::init(d, 22, new typ::Interface::•(d.[](17))); |
| 66 dec::init(d, 23, new typ::Interface::•(d.[](17))); |
| 67 return d; |
| 68 }.call(dec::allocateDeclarations(<dynamic>["X", "Y", "C", "D", "Null", "bool", "
String", "int", "double", "Type", "AbstractClassInstantiationError", "NoSuchMeth
odError", "CyclicInitializationError", "UnsupportedError", "IntegerDivisionByZer
oException", "RangeError", "ArgumentError", "Object", "HasRuntimeTypeGetter", "C
omparable", "Pattern", "num", "Error", "Exception"], <dynamic>[0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0])); |
| 69 static method main() → dynamic { |
| 70 self::Y y = new self::Y::•(); |
| 71 self::C c = new self::C::•(); |
| 72 self::D d = new self::D::•(); |
| 73 tes::expectTrue(c.{self::C::fun}(y, $typeParameters: <typ::ReifiedType>[new ty
p::Interface::•(self::$declarations.[](1))]).{core::String::==}("C")); |
| 74 tes::expectTrue(d.{self::D::fun}(y, $typeParameters: <typ::ReifiedType>[new ty
p::Interface::•(self::$declarations.[](1))]).{core::String::==}("D")); |
| 75 } |
OLD | NEW |