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 extends core::Object { | 5 class Foo extends core::Object { |
6 constructor •() → void | 6 default constructor •() → void |
7 : super core::Object::•() | 7 : super core::Object::•() |
8 ; | 8 ; |
9 method instanceMethod() → dynamic { | 9 method instanceMethod() → dynamic { |
10 return 123; | 10 return 123; |
11 } | 11 } |
12 } | 12 } |
13 abstract class ExternalValue extends core::Object { | 13 abstract class ExternalValue extends core::Object { |
14 constructor •() → void | 14 default constructor •() → void |
15 : super core::Object::•() | 15 : super core::Object::•() |
16 ; | 16 ; |
17 } | 17 } |
18 abstract class Bar extends core::Object { | 18 abstract class Bar extends core::Object { |
19 constructor •() → void | 19 default constructor •() → void |
20 : super core::Object::•() | 20 : super core::Object::•() |
21 ; | 21 ; |
22 abstract method externalInstanceMethod() → self::ExternalValue; | 22 abstract method externalInstanceMethod() → self::ExternalValue; |
23 } | 23 } |
24 class Box extends core::Object { | 24 class Box extends core::Object { |
25 field dynamic field = null; | 25 field dynamic field = null; |
26 constructor •() → void | 26 default constructor •() → void |
27 : super core::Object::•() | 27 : super core::Object::•() |
28 ; | 28 ; |
29 } | 29 } |
30 class FinalBox extends core::Object { | 30 class FinalBox extends core::Object { |
31 final field dynamic finalField; | 31 final field dynamic finalField; |
32 constructor •(dynamic finalField) → void | 32 constructor •(dynamic finalField) → void |
33 : self::FinalBox::finalField = finalField, super core::Object::•() | 33 : self::FinalBox::finalField = finalField, super core::Object::•() |
34 ; | 34 ; |
35 } | 35 } |
36 class SubFinalBox extends self::FinalBox { | 36 class SubFinalBox extends self::FinalBox { |
37 constructor •(dynamic value) → void | 37 constructor •(dynamic value) → void |
38 : super self::FinalBox::•(value) | 38 : super self::FinalBox::•(value) |
39 ; | 39 ; |
40 } | 40 } |
41 class DynamicReceiver1 extends core::Object { | 41 class DynamicReceiver1 extends core::Object { |
42 constructor •() → void | 42 default constructor •() → void |
43 : super core::Object::•() | 43 : super core::Object::•() |
44 ; | 44 ; |
45 method dynamicallyCalled(dynamic x) → dynamic {} | 45 method dynamicallyCalled(dynamic x) → dynamic {} |
46 } | 46 } |
47 class DynamicReceiver2 extends core::Object { | 47 class DynamicReceiver2 extends core::Object { |
48 constructor •() → void | 48 default constructor •() → void |
49 : super core::Object::•() | 49 : super core::Object::•() |
50 ; | 50 ; |
51 method dynamicallyCalled(dynamic x) → dynamic {} | 51 method dynamicallyCalled(dynamic x) → dynamic {} |
52 } | 52 } |
53 static method staticMethod() → dynamic { | 53 static method staticMethod() → dynamic { |
54 return "sdfg"; | 54 return "sdfg"; |
55 } | 55 } |
56 external static method externalStatic() → core::bool; | 56 external static abstract method externalStatic() → core::bool; |
Johnni Winther
2017/07/14 10:13:51
Why have these changed?
| |
57 external static method createBar() → self::Bar; | 57 external static abstract method createBar() → self::Bar; |
58 static method stringArgument(dynamic x) → dynamic {} | 58 static method stringArgument(dynamic x) → dynamic {} |
59 static method intArgument(dynamic x) → dynamic {} | 59 static method intArgument(dynamic x) → dynamic {} |
60 static method makeDynamicCall(dynamic receiver) → void { | 60 static method makeDynamicCall(dynamic receiver) → void { |
61 receiver.dynamicallyCalled("sdfg"); | 61 receiver.dynamicallyCalled("sdfg"); |
62 } | 62 } |
63 static method main() → dynamic { | 63 static method main() → dynamic { |
64 dynamic x = self::staticMethod(); | 64 dynamic x = self::staticMethod(); |
65 dynamic y = new self::Foo::•().instanceMethod(); | 65 dynamic y = new self::Foo::•().instanceMethod(); |
66 dynamic z = self::externalStatic(); | 66 dynamic z = self::externalStatic(); |
67 dynamic w = self::createBar().externalInstanceMethod(); | 67 dynamic w = self::createBar().externalInstanceMethod(); |
68 self::stringArgument("sdfg"); | 68 self::stringArgument("sdfg"); |
69 self::intArgument(42); | 69 self::intArgument(42); |
70 dynamic box = new self::Box::•(); | 70 dynamic box = new self::Box::•(); |
71 box.field = "sdfg"; | 71 box.field = "sdfg"; |
72 dynamic a = box.field; | 72 dynamic a = box.field; |
73 dynamic finalBox = new self::FinalBox::•("dfg"); | 73 dynamic finalBox = new self::FinalBox::•("dfg"); |
74 dynamic b = finalBox.finalField; | 74 dynamic b = finalBox.finalField; |
75 dynamic subBox = new self::SubFinalBox::•("dfg"); | 75 dynamic subBox = new self::SubFinalBox::•("dfg"); |
76 dynamic c = subBox.finalField; | 76 dynamic c = subBox.finalField; |
77 self::makeDynamicCall(new self::DynamicReceiver1::•()); | 77 self::makeDynamicCall(new self::DynamicReceiver1::•()); |
78 self::makeDynamicCall(new self::DynamicReceiver2::•()); | 78 self::makeDynamicCall(new self::DynamicReceiver2::•()); |
79 dynamic list = <dynamic>["string"]; | 79 dynamic list = <dynamic>["string"]; |
80 dynamic d = list.[](0); | 80 dynamic d = list.[](0); |
81 } | 81 } |
OLD | NEW |