OLD | NEW |
1 library closure_test; | 1 library closure_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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 class Closure#bar extends core::Object implements core::Function, int::HasRuntim
eTypeGetter { | 52 class Closure#bar extends core::Object implements core::Function, int::HasRuntim
eTypeGetter { |
53 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | 53 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
54 constructor •() → dynamic | 54 constructor •() → dynamic |
55 ; | 55 ; |
56 method call(self::A a) → dynamic | 56 method call(self::A a) → dynamic |
57 return self::bar(a); | 57 return self::bar(a); |
58 get $type() → typ::ReifiedType | 58 get $type() → typ::ReifiedType |
59 return new typ::Interface::•(self::$declarations.[](4)); | 59 return new typ::Interface::•(self::$declarations.[](4)); |
60 } | 60 } |
61 class Closure#bar extends core::Object implements core::Function, int::HasRuntim
eTypeGetter { | |
62 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | |
63 constructor •() → dynamic | |
64 ; | |
65 method call(self::A a) → dynamic | |
66 return self::bar(a); | |
67 get $type() → typ::ReifiedType | |
68 return new typ::Interface::•(self::$declarations.[](5)); | |
69 } | |
70 class Closure#baz extends core::Object implements core::Function, int::HasRuntim
eTypeGetter { | 61 class Closure#baz extends core::Object implements core::Function, int::HasRuntim
eTypeGetter { |
71 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | 62 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
72 constructor •() → dynamic | 63 constructor •() → dynamic |
73 ; | |
74 method call(dynamic a) → self::B | |
75 return self::baz(a); | |
76 get $type() → typ::ReifiedType | |
77 return new typ::Interface::•(self::$declarations.[](6)); | |
78 } | |
79 class Closure#baz extends core::Object implements core::Function, int::HasRuntim
eTypeGetter { | |
80 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | |
81 constructor •() → dynamic | |
82 ; | 64 ; |
83 method call(dynamic a) → self::B | 65 method call(dynamic a) → self::B |
84 return self::baz(a); | 66 return self::baz(a); |
85 get $type() → typ::ReifiedType | 67 get $type() → typ::ReifiedType |
86 return new typ::Interface::•(self::$declarations.[](7)); | 68 return new typ::Interface::•(self::$declarations.[](5)); |
87 } | |
88 class Closure#bar extends core::Object implements core::Function, int::HasRuntim
eTypeGetter { | |
89 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | |
90 constructor •() → dynamic | |
91 ; | |
92 method call(self::A a) → dynamic | |
93 return self::bar(a); | |
94 get $type() → typ::ReifiedType | |
95 return new typ::Interface::•(self::$declarations.[](8)); | |
96 } | |
97 class Closure#baz extends core::Object implements core::Function, int::HasRuntim
eTypeGetter { | |
98 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | |
99 constructor •() → dynamic | |
100 ; | |
101 method call(dynamic a) → self::B | |
102 return self::baz(a); | |
103 get $type() → typ::ReifiedType | |
104 return new typ::Interface::•(self::$declarations.[](9)); | |
105 } | 69 } |
106 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { | 70 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { |
107 dec::init(d, 0, new typ::Interface::•(d.[](24))); | 71 dec::init(d, 0, new typ::Interface::•(d.[](20))); |
108 dec::init(d, 1, new typ::Interface::•(d.[](24))); | 72 dec::init(d, 1, new typ::Interface::•(d.[](20))); |
109 dec::init(d, 2, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface:
:•(d.[](10))], new typ::FunctionType::•(new typ::Interface::•(d.[](10)), new typ
::Interface::•(d.[](1)), 0, <dynamic>[new typ::Interface::•(d.[](0))])); | 73 dec::init(d, 2, new typ::Interface::•(d.[](20)), <dynamic>[new typ::Interface:
:•(d.[](6))], new typ::FunctionType::•(new typ::Interface::•(d.[](6)), new typ::
Interface::•(d.[](1)), 0, <dynamic>[new typ::Interface::•(d.[](0))])); |
110 dec::init(d, 3, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface:
:•(d.[](10))], new typ::FunctionType::•(new typ::Interface::•(d.[](10)), new typ
::Interface::•(d.[](0)), 0, <dynamic>[new typ::Interface::•(d.[](1))])); | 74 dec::init(d, 3, new typ::Interface::•(d.[](20)), <dynamic>[new typ::Interface:
:•(d.[](6))], new typ::FunctionType::•(new typ::Interface::•(d.[](6)), new typ::
Interface::•(d.[](0)), 0, <dynamic>[new typ::Interface::•(d.[](1))])); |
111 dec::init(d, 4, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface:
:•(d.[](10))], new typ::FunctionType::•(new typ::Interface::•(d.[](10)), const t
yp::Dynamic::•(), 0, <dynamic>[new typ::Interface::•(d.[](0))])); | 75 dec::init(d, 4, new typ::Interface::•(d.[](20)), <dynamic>[new typ::Interface:
:•(d.[](6))], new typ::FunctionType::•(new typ::Interface::•(d.[](6)), const typ
::Dynamic::•(), 0, <dynamic>[new typ::Interface::•(d.[](0))])); |
112 dec::init(d, 5, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface:
:•(d.[](10))], new typ::FunctionType::•(new typ::Interface::•(d.[](10)), const t
yp::Dynamic::•(), 0, <dynamic>[new typ::Interface::•(d.[](0))])); | 76 dec::init(d, 5, new typ::Interface::•(d.[](20)), <dynamic>[new typ::Interface:
:•(d.[](6))], new typ::FunctionType::•(new typ::Interface::•(d.[](6)), new typ::
Interface::•(d.[](1)), 0, <dynamic>[const typ::Dynamic::•()])); |
113 dec::init(d, 6, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface:
:•(d.[](10))], new typ::FunctionType::•(new typ::Interface::•(d.[](10)), new typ
::Interface::•(d.[](1)), 0, <dynamic>[const typ::Dynamic::•()])); | 77 dec::init(d, 6, new typ::Interface::•(d.[](20))); |
114 dec::init(d, 7, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface:
:•(d.[](10))], new typ::FunctionType::•(new typ::Interface::•(d.[](10)), new typ
::Interface::•(d.[](1)), 0, <dynamic>[const typ::Dynamic::•()])); | 78 dec::init(d, 7, new typ::Interface::•(d.[](20))); |
115 dec::init(d, 8, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface:
:•(d.[](10))], new typ::FunctionType::•(new typ::Interface::•(d.[](10)), const t
yp::Dynamic::•(), 0, <dynamic>[new typ::Interface::•(d.[](0))])); | 79 dec::init(d, 8, new typ::Interface::•(d.[](20))); |
116 dec::init(d, 9, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface:
:•(d.[](10))], new typ::FunctionType::•(new typ::Interface::•(d.[](10)), new typ
::Interface::•(d.[](1)), 0, <dynamic>[const typ::Dynamic::•()])); | 80 dec::init(d, 9, new typ::Interface::•(d.[](20)), <dynamic>[new typ::Interface:
:•(d.[](22), <dynamic>[new typ::Interface::•(d.[](9))]), new typ::Interface::•(d
.[](23))]); |
117 dec::init(d, 10, new typ::Interface::•(d.[](24))); | 81 dec::init(d, 10, new typ::Interface::•(d.[](24))); |
118 dec::init(d, 11, new typ::Interface::•(d.[](24))); | 82 dec::init(d, 11, new typ::Interface::•(d.[](24))); |
119 dec::init(d, 12, new typ::Interface::•(d.[](24))); | 83 dec::init(d, 12, new typ::Interface::•(d.[](20))); |
120 dec::init(d, 13, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface
::•(d.[](26), <dynamic>[new typ::Interface::•(d.[](13))]), new typ::Interface::•
(d.[](27))]); | 84 dec::init(d, 13, new typ::Interface::•(d.[](25))); |
121 dec::init(d, 14, new typ::Interface::•(d.[](28))); | 85 dec::init(d, 14, new typ::Interface::•(d.[](25))); |
122 dec::init(d, 15, new typ::Interface::•(d.[](28))); | 86 dec::init(d, 15, new typ::Interface::•(d.[](25))); |
123 dec::init(d, 16, new typ::Interface::•(d.[](24))); | 87 dec::init(d, 16, new typ::Interface::•(d.[](25))); |
124 dec::init(d, 17, new typ::Interface::•(d.[](29))); | 88 dec::init(d, 17, new typ::Interface::•(d.[](20)), <dynamic>[new typ::Interface
::•(d.[](26))]); |
125 dec::init(d, 18, new typ::Interface::•(d.[](29))); | 89 dec::init(d, 18, new typ::Interface::•(d.[](19))); |
126 dec::init(d, 19, new typ::Interface::•(d.[](29))); | 90 dec::init(d, 19, new typ::Interface::•(d.[](25))); |
127 dec::init(d, 20, new typ::Interface::•(d.[](29))); | 91 dec::init(d, 20, null); |
128 dec::init(d, 21, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface
::•(d.[](30))]); | 92 dec::init(d, 22, new typ::Interface::•(d.[](20))); |
129 dec::init(d, 22, new typ::Interface::•(d.[](23))); | 93 dec::init(d, 23, new typ::Interface::•(d.[](20))); |
130 dec::init(d, 23, new typ::Interface::•(d.[](29))); | 94 dec::init(d, 24, new typ::Interface::•(d.[](20)), <dynamic>[new typ::Interface
::•(d.[](22), <dynamic>[new typ::Interface::•(d.[](24))])]); |
131 dec::init(d, 24, null); | 95 dec::init(d, 25, new typ::Interface::•(d.[](20))); |
132 dec::init(d, 26, new typ::Interface::•(d.[](24))); | 96 dec::init(d, 26, new typ::Interface::•(d.[](20))); |
133 dec::init(d, 27, new typ::Interface::•(d.[](24))); | |
134 dec::init(d, 28, new typ::Interface::•(d.[](24)), <dynamic>[new typ::Interface
::•(d.[](26), <dynamic>[new typ::Interface::•(d.[](28))])]); | |
135 dec::init(d, 29, new typ::Interface::•(d.[](24))); | |
136 dec::init(d, 30, new typ::Interface::•(d.[](24))); | |
137 return d; | 97 return d; |
138 }.call(dec::allocateDeclarations(<dynamic>["A", "B", "Closure#main#foo", "Closur
e#main#qux", "Closure#bar", "Closure#bar", "Closure#baz", "Closure#baz", "Closur
e#bar", "Closure#baz", "Function", "Null", "bool", "String", "int", "double", "T
ype", "AbstractClassInstantiationError", "NoSuchMethodError", "CyclicInitializat
ionError", "UnsupportedError", "IntegerDivisionByZeroException", "RangeError", "
ArgumentError", "Object", "HasRuntimeTypeGetter", "Comparable", "Pattern", "num"
, "Error", "Exception"], <dynamic>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0])); | 98 }.call(dec::allocateDeclarations(<dynamic>["A", "B", "Closure#main#foo", "Closur
e#main#qux", "Closure#bar", "Closure#baz", "Function", "Null", "bool", "String",
"int", "double", "Type", "AbstractClassInstantiationError", "NoSuchMethodError"
, "CyclicInitializationError", "UnsupportedError", "IntegerDivisionByZeroExcepti
on", "RangeError", "ArgumentError", "Object", "HasRuntimeTypeGetter", "Comparabl
e", "Pattern", "num", "Error", "Exception"], <dynamic>[0, 0, 0, 0, 0, 0, 0, 0, 0
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0])); |
139 static method bar(self::A a) → dynamic { | 99 static method bar(self::A a) → dynamic { |
140 return null; | 100 return null; |
141 } | 101 } |
142 static method baz(dynamic a) → self::B { | 102 static method baz(dynamic a) → self::B { |
143 return null; | 103 return null; |
144 } | 104 } |
145 static method main() → dynamic { | 105 static method main() → dynamic { |
146 final (self::A) → self::B foo = new self::Closure#main#foo::•(null); | 106 final (self::A) → self::B foo = new self::Closure#main#foo::•(null); |
147 final (self::B) → self::A qux = new self::Closure#main#qux::•(null); | 107 final (self::B) → self::A qux = new self::Closure#main#qux::•(null); |
148 tes::expectTrue(typ::isSubtypeOf(int::type(foo), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](10)), new typ::Interface::•(self::$decl
arations.[](1)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](0))])
)); | 108 tes::expectTrue(typ::isSubtypeOf(int::type(foo), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](6)), new typ::Interface::•(self::$decla
rations.[](1)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](0))]))
); |
149 tes::expectTrue(!typ::isSubtypeOf(int::type(qux), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](10)), new typ::Interface::•(self::$dec
larations.[](1)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](0))]
))); | 109 tes::expectTrue(!typ::isSubtypeOf(int::type(qux), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](6)), new typ::Interface::•(self::$decl
arations.[](1)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](0))])
)); |
150 tes::expectTrue(!typ::isSubtypeOf(int::type(foo), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](10)), new typ::Interface::•(self::$dec
larations.[](0)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](1))]
))); | 110 tes::expectTrue(!typ::isSubtypeOf(int::type(foo), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](6)), new typ::Interface::•(self::$decl
arations.[](0)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](1))])
)); |
151 tes::expectTrue(typ::isSubtypeOf(int::type(qux), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](10)), new typ::Interface::•(self::$decl
arations.[](0)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](1))])
)); | 111 tes::expectTrue(typ::isSubtypeOf(int::type(qux), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](6)), new typ::Interface::•(self::$decla
rations.[](0)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](1))]))
); |
152 tes::expectTrue(typ::isSubtypeOf(int::type(new self::Closure#bar::•()), new ty
p::FunctionType::•(new typ::Interface::•(self::$declarations.[](10)), new typ::I
nterface::•(self::$declarations.[](1)), 0, <dynamic>[new typ::Interface::•(self:
:$declarations.[](0))]))); | 112 tes::expectTrue(typ::isSubtypeOf(int::type(new self::Closure#bar::•()), new ty
p::FunctionType::•(new typ::Interface::•(self::$declarations.[](6)), new typ::In
terface::•(self::$declarations.[](1)), 0, <dynamic>[new typ::Interface::•(self::
$declarations.[](0))]))); |
153 tes::expectTrue(!typ::isSubtypeOf(int::type(new self::Closure#bar::•()), new t
yp::FunctionType::•(new typ::Interface::•(self::$declarations.[](10)), new typ::
Interface::•(self::$declarations.[](0)), 0, <dynamic>[new typ::Interface::•(self
::$declarations.[](1))]))); | 113 tes::expectTrue(!typ::isSubtypeOf(int::type(new self::Closure#bar::•()), new t
yp::FunctionType::•(new typ::Interface::•(self::$declarations.[](6)), new typ::I
nterface::•(self::$declarations.[](0)), 0, <dynamic>[new typ::Interface::•(self:
:$declarations.[](1))]))); |
154 tes::expectTrue(typ::isSubtypeOf(int::type(new self::Closure#baz::•()), new ty
p::FunctionType::•(new typ::Interface::•(self::$declarations.[](10)), new typ::I
nterface::•(self::$declarations.[](1)), 0, <dynamic>[new typ::Interface::•(self:
:$declarations.[](0))]))); | 114 tes::expectTrue(typ::isSubtypeOf(int::type(new self::Closure#baz::•()), new ty
p::FunctionType::•(new typ::Interface::•(self::$declarations.[](6)), new typ::In
terface::•(self::$declarations.[](1)), 0, <dynamic>[new typ::Interface::•(self::
$declarations.[](0))]))); |
155 tes::expectTrue(!typ::isSubtypeOf(int::type(new self::Closure#baz::•()), new t
yp::FunctionType::•(new typ::Interface::•(self::$declarations.[](10)), new typ::
Interface::•(self::$declarations.[](0)), 0, <dynamic>[new typ::Interface::•(self
::$declarations.[](1))]))); | 115 tes::expectTrue(!typ::isSubtypeOf(int::type(new self::Closure#baz::•()), new t
yp::FunctionType::•(new typ::Interface::•(self::$declarations.[](6)), new typ::I
nterface::•(self::$declarations.[](0)), 0, <dynamic>[new typ::Interface::•(self:
:$declarations.[](1))]))); |
156 dynamic rab = new self::Closure#bar::•(); | 116 (self::A) → dynamic rab = new self::Closure#bar::•(); |
157 dynamic zab = new self::Closure#baz::•(); | 117 (dynamic) → self::B zab = new self::Closure#baz::•(); |
158 tes::expectTrue(typ::isSubtypeOf(int::type(rab), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](10)), new typ::Interface::•(self::$decl
arations.[](1)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](0))])
)); | 118 tes::expectTrue(typ::isSubtypeOf(int::type(rab), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](6)), new typ::Interface::•(self::$decla
rations.[](1)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](0))]))
); |
159 tes::expectTrue(!typ::isSubtypeOf(int::type(rab), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](10)), new typ::Interface::•(self::$dec
larations.[](0)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](1))]
))); | 119 tes::expectTrue(!typ::isSubtypeOf(int::type(rab), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](6)), new typ::Interface::•(self::$decl
arations.[](0)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](1))])
)); |
160 tes::expectTrue(typ::isSubtypeOf(int::type(zab), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](10)), new typ::Interface::•(self::$decl
arations.[](1)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](0))])
)); | 120 tes::expectTrue(typ::isSubtypeOf(int::type(zab), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](6)), new typ::Interface::•(self::$decla
rations.[](1)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](0))]))
); |
161 tes::expectTrue(!typ::isSubtypeOf(int::type(zab), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](10)), new typ::Interface::•(self::$dec
larations.[](0)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](1))]
))); | 121 tes::expectTrue(!typ::isSubtypeOf(int::type(zab), new typ::FunctionType::•(new
typ::Interface::•(self::$declarations.[](6)), new typ::Interface::•(self::$decl
arations.[](0)), 0, <dynamic>[new typ::Interface::•(self::$declarations.[](1))])
)); |
162 } | 122 } |
OLD | NEW |