OLD | NEW |
1 library closure2_test; | 1 library closure2_test; |
2 import self as self; | 2 import self as self; |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "../../runtime/reify/interceptors.dart" as int; | 4 import "../../runtime/reify/interceptors.dart" as int; |
5 import "../../runtime/reify/types.dart" as typ; | 5 import "../../runtime/reify/types.dart" as typ; |
6 import "dart:mock" as mock; | 6 import "dart:mock" as mock; |
7 import "./test_base.dart" as tes; | 7 import "./test_base.dart" as tes; |
8 import "../../runtime/reify/declarations.dart" as dec; | 8 import "../../runtime/reify/declarations.dart" as dec; |
9 | 9 |
10 class A extends core::Object implements int::HasRuntimeTypeGetter { | 10 class A extends core::Object implements int::HasRuntimeTypeGetter { |
(...skipping 23 matching lines...) Expand all Loading... |
34 get $type() → typ::ReifiedType | 34 get $type() → typ::ReifiedType |
35 return new typ::Interface::•(self::$declarations.[](3)); | 35 return new typ::Interface::•(self::$declarations.[](3)); |
36 } | 36 } |
37 class Closure#A#fun#function extends core::Object implements core::Function, int
::HasRuntimeTypeGetter { | 37 class Closure#A#fun#function extends core::Object implements core::Function, int
::HasRuntimeTypeGetter { |
38 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | 38 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
39 field mock::Context context; | 39 field mock::Context context; |
40 final field typ::ReifiedType $type; | 40 final field typ::ReifiedType $type; |
41 constructor •(typ::ReifiedType $type, final mock::Context context) → dynamic | 41 constructor •(typ::ReifiedType $type, final mock::Context context) → dynamic |
42 : self::Closure#A#fun#function::$type = $type, self::Closure#A#fun#function:
:context = context | 42 : self::Closure#A#fun#function::$type = $type, self::Closure#A#fun#function:
:context = context |
43 ; | 43 ; |
44 method call(dynamic o) → dynamic { | 44 method call(dynamic o) → core::bool { |
45 "This is a temporary solution. In the VM, this will become an additional par
ameter."; | 45 "This is a temporary solution. In the VM, this will become an additional par
ameter."; |
46 final mock::Context #contextParameter = this.{self::Closure#A#fun#function::
context}; | 46 final mock::Context #contextParameter = this.{self::Closure#A#fun#function::
context}; |
47 return typ::isSubtypeOf(int::type(o), this.$Closure#A#fun#function$T); | 47 return typ::isSubtypeOf(int::type(o), this.$Closure#A#fun#function$T); |
48 } | 48 } |
49 get $Closure#A#fun#function$T() → typ::ReifiedType | 49 get $Closure#A#fun#function$T() → typ::ReifiedType |
50 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](1))).[](0); | 50 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](1))).[](0); |
51 get runtimeType() → core::Type | 51 get runtimeType() → core::Type |
52 return this.{=self::Closure#A#fun#function::$type}; | 52 return this.{=self::Closure#A#fun#function::$type}; |
53 } | 53 } |
54 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { | 54 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { |
55 dec::init(d, 0, new typ::Interface::•(d.[](17))); | 55 dec::init(d, 0, new typ::Interface::•(d.[](17))); |
56 dec::init(d, 1, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface:
:•(d.[](19))], new typ::FunctionType::•(new typ::Interface::•(d.[](19)), const t
yp::Dynamic::•(), 0, <dynamic>[const typ::Dynamic::•()])); | 56 dec::init(d, 1, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface:
:•(d.[](19))], new typ::FunctionType::•(new typ::Interface::•(d.[](19)), new typ
::Interface::•(d.[](5)), 0, <dynamic>[const typ::Dynamic::•()])); |
57 dec::init(d, 2, new typ::Interface::•(d.[](17))); | 57 dec::init(d, 2, new typ::Interface::•(d.[](17))); |
58 dec::init(d, 3, new typ::Interface::•(d.[](17))); | 58 dec::init(d, 3, new typ::Interface::•(d.[](17))); |
59 dec::init(d, 4, new typ::Interface::•(d.[](17))); | 59 dec::init(d, 4, new typ::Interface::•(d.[](17))); |
60 dec::init(d, 5, new typ::Interface::•(d.[](17))); | 60 dec::init(d, 5, new typ::Interface::•(d.[](17))); |
61 dec::init(d, 6, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface:
:•(d.[](20), <dynamic>[new typ::Interface::•(d.[](6))]), new typ::Interface::•(d
.[](21))]); | 61 dec::init(d, 6, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface:
:•(d.[](20), <dynamic>[new typ::Interface::•(d.[](6))]), new typ::Interface::•(d
.[](21))]); |
62 dec::init(d, 7, new typ::Interface::•(d.[](22))); | 62 dec::init(d, 7, new typ::Interface::•(d.[](22))); |
63 dec::init(d, 8, new typ::Interface::•(d.[](22))); | 63 dec::init(d, 8, new typ::Interface::•(d.[](22))); |
64 dec::init(d, 9, new typ::Interface::•(d.[](17))); | 64 dec::init(d, 9, new typ::Interface::•(d.[](17))); |
65 dec::init(d, 10, new typ::Interface::•(d.[](23))); | 65 dec::init(d, 10, new typ::Interface::•(d.[](23))); |
66 dec::init(d, 11, new typ::Interface::•(d.[](23))); | 66 dec::init(d, 11, new typ::Interface::•(d.[](23))); |
67 dec::init(d, 12, new typ::Interface::•(d.[](23))); | 67 dec::init(d, 12, new typ::Interface::•(d.[](23))); |
68 dec::init(d, 13, new typ::Interface::•(d.[](23))); | 68 dec::init(d, 13, new typ::Interface::•(d.[](23))); |
69 dec::init(d, 14, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface
::•(d.[](24))]); | 69 dec::init(d, 14, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface
::•(d.[](24))]); |
70 dec::init(d, 15, new typ::Interface::•(d.[](16))); | 70 dec::init(d, 15, new typ::Interface::•(d.[](16))); |
71 dec::init(d, 16, new typ::Interface::•(d.[](23))); | 71 dec::init(d, 16, new typ::Interface::•(d.[](23))); |
72 dec::init(d, 17, null); | 72 dec::init(d, 17, null); |
73 dec::init(d, 19, new typ::Interface::•(d.[](17))); | 73 dec::init(d, 19, new typ::Interface::•(d.[](17))); |
74 dec::init(d, 20, new typ::Interface::•(d.[](17))); | 74 dec::init(d, 20, new typ::Interface::•(d.[](17))); |
75 dec::init(d, 21, new typ::Interface::•(d.[](17))); | 75 dec::init(d, 21, new typ::Interface::•(d.[](17))); |
76 dec::init(d, 22, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface
::•(d.[](20), <dynamic>[new typ::Interface::•(d.[](22))])]); | 76 dec::init(d, 22, new typ::Interface::•(d.[](17)), <dynamic>[new typ::Interface
::•(d.[](20), <dynamic>[new typ::Interface::•(d.[](22))])]); |
77 dec::init(d, 23, new typ::Interface::•(d.[](17))); | 77 dec::init(d, 23, new typ::Interface::•(d.[](17))); |
78 dec::init(d, 24, new typ::Interface::•(d.[](17))); | 78 dec::init(d, 24, new typ::Interface::•(d.[](17))); |
79 return d; | 79 return d; |
80 }.call(dec::allocateDeclarations(<dynamic>["A", "Closure#A#fun#function", "X", "
Y", "Null", "bool", "String", "int", "double", "Type", "AbstractClassInstantiati
onError", "NoSuchMethodError", "CyclicInitializationError", "UnsupportedError",
"IntegerDivisionByZeroException", "RangeError", "ArgumentError", "Object", "HasR
untimeTypeGetter", "Function", "Comparable", "Pattern", "num", "Error", "Excepti
on"], <dynamic>[1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0
, 0, 0, 0])); | 80 }.call(dec::allocateDeclarations(<dynamic>["A", "Closure#A#fun#function", "X", "
Y", "Null", "bool", "String", "int", "double", "Type", "AbstractClassInstantiati
onError", "NoSuchMethodError", "CyclicInitializationError", "UnsupportedError",
"IntegerDivisionByZeroException", "RangeError", "ArgumentError", "Object", "HasR
untimeTypeGetter", "Function", "Comparable", "Pattern", "num", "Error", "Excepti
on"], <dynamic>[1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0
, 0, 0, 0])); |
81 static method main() → dynamic { | 81 static method main() → dynamic { |
82 dynamic tester = new self::A::•(new typ::Interface::•(self::$declarations.[](0
), <dynamic>[new typ::Interface::•(self::$declarations.[](2))])).fun(); | 82 dynamic tester = new self::A::•(new typ::Interface::•(self::$declarations.[](0
), <dynamic>[new typ::Interface::•(self::$declarations.[](2))])).{self::A::fun}(
); |
83 tes::expectTrue(tester.call(new self::X::•())); | 83 tes::expectTrue(tester.call(new self::X::•())); |
84 tes::expectFalse(tester.call(new self::Y::•())); | 84 tes::expectFalse(tester.call(new self::Y::•())); |
85 } | 85 } |
OLD | NEW |