OLD | NEW |
1 library; | 1 library; |
2 import self as self; | 2 import self as self; |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 | 4 |
5 class C extends core::Object { | 5 class C extends core::Object { |
6 field dynamic f = MakeClosure<() → dynamic>(self::closure#C#f#function, null); | 6 field dynamic f = MakeClosure<() → dynamic>(self::closure#C#f#function, null); |
7 default constructor •() → void | 7 default constructor •() → void |
8 : super core::Object::•() | 8 : super core::Object::•() |
9 ; | 9 ; |
10 get g() → dynamic { | 10 get g() → dynamic |
11 return MakeClosure<(dynamic) → dynamic>(self::closure#C#g#function, null); | 11 return MakeClosure<(dynamic) → dynamic>(self::closure#C#g#function, null); |
12 } | 12 method a() → dynamic |
13 method a() → dynamic { | |
14 return "a"; | 13 return "a"; |
15 } | 14 method b(dynamic x) → dynamic |
16 method b(dynamic x) → dynamic { | |
17 return x; | 15 return x; |
18 } | 16 method c(dynamic x, [dynamic y = 2]) → dynamic |
19 method c(dynamic x, [dynamic y = 2]) → dynamic { | |
20 return x.+(y); | 17 return x.+(y); |
21 } | 18 method d(dynamic x, {dynamic y = 2}) → dynamic |
22 method d(dynamic x, {dynamic y = 2}) → dynamic { | |
23 return x.+(y); | 19 return x.+(y); |
24 } | |
25 } | 20 } |
26 class D<T extends core::Object> extends core::Object { | 21 class D<T extends core::Object> extends core::Object { |
27 field dynamic f = MakeClosure<() → dynamic>(self::closure#D#f#function, null); | 22 field dynamic f = MakeClosure<() → dynamic>(self::closure#D#f#function, null); |
28 default constructor •() → void | 23 default constructor •() → void |
29 : super core::Object::•() | 24 : super core::Object::•() |
30 ; | 25 ; |
31 get g() → dynamic { | 26 get g() → dynamic |
32 return MakeClosure<(dynamic) → dynamic>(self::closure#D#g#function, null); | 27 return MakeClosure<(dynamic) → dynamic>(self::closure#D#g#function, null); |
33 } | 28 method a() → dynamic |
34 method a() → dynamic { | |
35 return "a"; | 29 return "a"; |
36 } | 30 method b(dynamic x) → dynamic |
37 method b(dynamic x) → dynamic { | |
38 return x; | 31 return x; |
39 } | 32 method c(dynamic x, [dynamic y = 2]) → dynamic |
40 method c(dynamic x, [dynamic y = 2]) → dynamic { | |
41 return x.+(y); | 33 return x.+(y); |
42 } | 34 method d(dynamic x, {dynamic y = 2}) → dynamic |
43 method d(dynamic x, {dynamic y = 2}) → dynamic { | |
44 return x.+(y); | 35 return x.+(y); |
45 } | |
46 } | 36 } |
47 class E<T extends core::Object> extends core::Object { | 37 class E<T extends core::Object> extends core::Object { |
48 field dynamic f = MakeClosure<() → dynamic>(self::closure#E#f#function, null); | 38 field dynamic f = MakeClosure<() → dynamic>(self::closure#E#f#function, null); |
49 default constructor •() → void | 39 default constructor •() → void |
50 : super core::Object::•() | 40 : super core::Object::•() |
51 ; | 41 ; |
52 get g() → dynamic { | 42 get g() → dynamic |
53 return MakeClosure<<T extends core::Object>(T) → dynamic, self::E::T>(self::
closure#E#g#function, null); | 43 return MakeClosure<<T extends core::Object>(T) → dynamic, self::E::T>(self::
closure#E#g#function, null); |
54 } | 44 method a() → dynamic |
55 method a() → dynamic { | |
56 return "a"; | 45 return "a"; |
57 } | 46 method b(self::E::T x) → dynamic |
58 method b(self::E::T x) → dynamic { | |
59 return x; | 47 return x; |
60 } | 48 method c(self::E::T x, [self::E::T y = 2]) → dynamic |
61 method c(self::E::T x, [self::E::T y = 2]) → dynamic { | |
62 return x.+(y); | 49 return x.+(y); |
63 } | 50 method d(self::E::T x, {self::E::T y = 2}) → dynamic |
64 method d(self::E::T x, {self::E::T y = 2}) → dynamic { | |
65 return x.+(y); | 51 return x.+(y); |
66 } | |
67 } | 52 } |
68 static method expect(dynamic expected, dynamic actual) → dynamic { | 53 static method expect(dynamic expected, dynamic actual) → dynamic { |
69 core::print("Expecting '${expected}' and got '${actual}'"); | 54 core::print("Expecting '${expected}' and got '${actual}'"); |
70 if(!expected.==(actual)) { | 55 if(!expected.==(actual)) { |
71 core::print("Expected '${expected}' but got '${actual}'"); | 56 core::print("Expected '${expected}' but got '${actual}'"); |
72 throw "Expected '${expected}' but got '${actual}'"; | 57 throw "Expected '${expected}' but got '${actual}'"; |
73 } | 58 } |
74 } | 59 } |
75 static method test(dynamic o) → dynamic { | 60 static method test(dynamic o) → dynamic { |
76 self::expect("f", o.f()); | 61 self::expect("f", o.f()); |
(...skipping 29 matching lines...) Expand all Loading... |
106 } | 91 } |
107 static method closure#D#f#function(Vector #contextParameter) → dynamic { | 92 static method closure#D#f#function(Vector #contextParameter) → dynamic { |
108 return "f"; | 93 return "f"; |
109 } | 94 } |
110 static method closure#E#g#function<T extends core::Object>(Vector #contextParame
ter, self::closure#E#g#function::T x) → dynamic { | 95 static method closure#E#g#function<T extends core::Object>(Vector #contextParame
ter, self::closure#E#g#function::T x) → dynamic { |
111 return "g(${x})"; | 96 return "g(${x})"; |
112 } | 97 } |
113 static method closure#E#f#function(Vector #contextParameter) → dynamic { | 98 static method closure#E#f#function(Vector #contextParameter) → dynamic { |
114 return "f"; | 99 return "f"; |
115 } | 100 } |
OLD | NEW |