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 Foo<T extends core::Object> extends core::Object { | 5 class Foo<T extends core::Object> extends core::Object { |
6 final field self::Foo::T finalField; | 6 final field self::Foo::T finalField; |
7 final field (self::Foo::T) → void callbackField; | 7 final field (self::Foo::T) → void callbackField; |
8 field self::Foo::T mutableField = null; | 8 field self::Foo::T mutableField = null; |
9 field (self::Foo::T) → void mutableCallbackField = null; | 9 field (self::Foo::T) → void mutableCallbackField = null; |
10 constructor •(self::Foo::T finalField, (self::Foo::T) → void callbackField) →
void | 10 constructor •(self::Foo::T finalField, (self::Foo::T) → void callbackField) →
void |
11 : self::Foo::finalField = finalField, self::Foo::callbackField = callbackFie
ld, super core::Object::•() | 11 : self::Foo::finalField = finalField, self::Foo::callbackField = callbackFie
ld, super core::Object::•() |
12 ; | 12 ; |
13 method method(self::Foo::T x) → void {} | 13 method method(self::Foo::T x) → void {} |
14 set setter(self::Foo::T x) → void {} | 14 set setter(self::Foo::T x) → void {} |
15 method withCallback((self::Foo::T) → void callback) → void { | 15 method withCallback((self::Foo::T) → void callback) → void { |
16 callback.call(this.{self::Foo::finalField}); | 16 callback.call(this.{self::Foo::finalField}); |
17 } | 17 } |
| 18 set mutableField$cc(core::Object mutableField_) → dynamic |
| 19 this.{=self::Foo::mutableField} = mutableField_ as self::Foo::T; |
| 20 method method$cc(core::Object x) → void |
| 21 this.{=self::Foo::method}(x as self::Foo::T); |
| 22 set setter$cc(core::Object x) → void |
| 23 this.{=self::Foo::setter} = x as self::Foo::T; |
18 } | 24 } |
19 static method main() → dynamic { | 25 static method main() → dynamic { |
20 self::Foo<core::int> fooInt = new self::Foo::•<core::int>(1, (core::int x) → c
ore::Null {}); | 26 self::Foo<core::int> fooInt = new self::Foo::•<core::int>(1, (core::int x) → c
ore::Null {}); |
21 fooInt.{self::Foo::method}(3); | 27 fooInt.{self::Foo::method}(3); |
22 fooInt.{self::Foo::setter} = 3; | 28 fooInt.{self::Foo::setter} = 3; |
23 fooInt.{self::Foo::withCallback}((core::int x) → core::Null {}); | 29 fooInt.{self::Foo::withCallback}((core::int x) → core::Null {}); |
24 fooInt.{self::Foo::withCallback}((core::num x) → core::Null {}); | 30 fooInt.{self::Foo::withCallback}((core::num x) → core::Null {}); |
25 fooInt.{self::Foo::mutableField} = 3; | 31 fooInt.{self::Foo::mutableField} = 3; |
26 fooInt.{self::Foo::mutableCallbackField} = (core::int x) → core::Null {}; | 32 fooInt.{self::Foo::mutableCallbackField} = (core::int x) → core::Null {}; |
27 self::Foo<core::num> fooNum = fooInt; | 33 self::Foo<core::num> fooNum = fooInt; |
28 fooNum.{self::Foo::method$cc}(3); | 34 fooNum.{self::Foo::method$cc}(3); |
29 fooNum.{self::Foo::method$cc}(2.5); | 35 fooNum.{self::Foo::method$cc}(2.5); |
30 fooNum.{self::Foo::setter$cc} = 3; | 36 fooNum.{self::Foo::setter$cc} = 3; |
31 fooNum.{self::Foo::setter$cc} = 2.5; | 37 fooNum.{self::Foo::setter$cc} = 2.5; |
32 fooNum.{self::Foo::withCallback}((core::num x) → core::Null {}); | 38 fooNum.{self::Foo::withCallback}((core::num x) → core::Null {}); |
33 fooNum.{self::Foo::mutableField$cc} = 3; | 39 fooNum.{self::Foo::mutableField$cc} = 3; |
34 fooNum.{self::Foo::mutableField$cc} = 2.5; | 40 fooNum.{self::Foo::mutableField$cc} = 2.5; |
35 fooNum.{self::Foo::mutableCallbackField}.call(3); | 41 fooNum.{self::Foo::mutableCallbackField}.call(3); |
36 fooNum.{self::Foo::mutableCallbackField}.call(2.5); | 42 fooNum.{self::Foo::mutableCallbackField}.call(2.5); |
37 fooNum.{self::Foo::mutableCallbackField} = (core::num x) → core::Null {}; | 43 fooNum.{self::Foo::mutableCallbackField} = (core::num x) → core::Null {}; |
38 } | 44 } |
OLD | NEW |