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 constructor •() → void | 6 default constructor •() → void |
7 : super core::Object::•() | 7 : super core::Object::•() |
8 ; | 8 ; |
9 set onlySetter(dynamic value) → void { | 9 set onlySetter(dynamic value) → void { |
10 core::print("C.onlySetter called with ${value}."); | 10 core::print("C.onlySetter called with ${value}."); |
11 } | 11 } |
12 method testC() → dynamic { | 12 method testC() → dynamic { |
13 try { | 13 try { |
14 core::print(this.onlySetter); | 14 core::print(this.onlySetter); |
15 throw "No error thrown"; | 15 throw "No error thrown"; |
16 } | 16 } |
17 on core::NoSuchMethodError catch(final core::NoSuchMethodError e) { | 17 on core::NoSuchMethodError catch(final core::NoSuchMethodError e) { |
18 core::print("Expected error: ${e}"); | 18 core::print("Expected error: ${e}"); |
19 } | 19 } |
20 this.onlySetter = "hest"; | 20 this.onlySetter = "hest"; |
21 } | 21 } |
22 method testD() → dynamic { | 22 method testD() → dynamic { |
23 core::print(this.onlySetter); | 23 core::print(this.onlySetter); |
24 this.onlySetter = "hest"; | 24 this.onlySetter = "hest"; |
25 } | 25 } |
26 } | 26 } |
27 class D extends self::C { | 27 class D extends self::C { |
28 constructor •() → void | 28 default constructor •() → void |
29 : super self::C::•() | 29 : super self::C::•() |
30 ; | 30 ; |
31 get onlySetter() → core::String | 31 get onlySetter() → core::String |
32 return "D.onlySetter called."; | 32 return "D.onlySetter called."; |
33 set onlySetter(dynamic value) → void { | 33 set onlySetter(dynamic value) → void { |
34 core::print("D.onlySetter called with ${value}."); | 34 core::print("D.onlySetter called with ${value}."); |
35 } | 35 } |
36 } | 36 } |
37 static set onlySetter(dynamic value) → void { | 37 static set onlySetter(dynamic value) → void { |
38 core::print("onlySetter called with ${value}."); | 38 core::print("onlySetter called with ${value}."); |
39 } | 39 } |
40 static method main() → dynamic { | 40 static method main() → dynamic { |
41 try { | 41 try { |
42 core::print(throw new core::NoSuchMethodError::_withType(null, #onlySetter,
33, <dynamic>[].toList(growable: false), <dynamic, dynamic>{}, null)); | 42 core::print(throw new core::NoSuchMethodError::_withType(null, #onlySetter,
33, <dynamic>[].toList(growable: false), <dynamic, dynamic>{}, null)); |
43 throw "No error thrown"; | 43 throw "No error thrown"; |
44 } | 44 } |
45 on core::NoSuchMethodError catch(final core::NoSuchMethodError e) { | 45 on core::NoSuchMethodError catch(final core::NoSuchMethodError e) { |
46 core::print("Expected error: ${e}"); | 46 core::print("Expected error: ${e}"); |
47 } | 47 } |
48 self::onlySetter = "fisk"; | 48 self::onlySetter = "fisk"; |
49 new self::C::•().testC(); | 49 new self::C::•().testC(); |
50 new self::D::•().testD(); | 50 new self::D::•().testD(); |
51 } | 51 } |
OLD | NEW |