OLD | NEW |
| (Empty) |
1 staticMethod() { | |
2 return "sdfg"; | |
3 } | |
4 | |
5 class Foo { | |
6 instanceMethod() { | |
7 return 123; | |
8 } | |
9 } | |
10 | |
11 external bool externalStatic(); | |
12 | |
13 abstract class ExternalValue {} | |
14 | |
15 abstract class Bar { | |
16 ExternalValue externalInstanceMethod(); | |
17 } | |
18 | |
19 external Bar createBar(); | |
20 | |
21 class Box { | |
22 var field; | |
23 } | |
24 | |
25 stringArgument(x) {} | |
26 | |
27 intArgument(x) {} | |
28 | |
29 class FinalBox { | |
30 final finalField; | |
31 FinalBox(this.finalField); | |
32 } | |
33 | |
34 class SubFinalBox extends FinalBox { | |
35 SubFinalBox(value) : super(value); | |
36 } | |
37 | |
38 class DynamicReceiver1 { | |
39 dynamicallyCalled(x) {} | |
40 } | |
41 | |
42 class DynamicReceiver2 { | |
43 dynamicallyCalled(x) {} | |
44 } | |
45 | |
46 void makeDynamicCall(receiver) { | |
47 receiver.dynamicallyCalled("sdfg"); | |
48 } | |
49 | |
50 main() { | |
51 var x = staticMethod(); | |
52 var y = new Foo().instanceMethod(); | |
53 var z = externalStatic(); | |
54 var w = createBar().externalInstanceMethod(); | |
55 | |
56 stringArgument("sdfg"); | |
57 intArgument(42); | |
58 | |
59 var box = new Box(); | |
60 box.field = "sdfg"; | |
61 var a = box.field; | |
62 | |
63 var finalBox = new FinalBox("dfg"); | |
64 var b = finalBox.finalField; | |
65 | |
66 var subBox = new SubFinalBox("dfg"); | |
67 var c = subBox.finalField; | |
68 | |
69 makeDynamicCall(new DynamicReceiver1()); | |
70 makeDynamicCall(new DynamicReceiver2()); | |
71 | |
72 var list = ["string"]; | |
73 var d = list[0]; | |
74 } | |
OLD | NEW |