OLD | NEW |
| (Empty) |
1 library; | |
2 import self as self; | |
3 import "dart:core" as core; | |
4 | |
5 class UnusedClass extends core::Object { | |
6 constructor •() → void | |
7 : super core::Object::•() { | |
8 core::print("Unused"); | |
9 } | |
10 } | |
11 abstract class UsedAsBaseClass extends core::Object { | |
12 constructor •() → void | |
13 : super core::Object::•() | |
14 ; | |
15 method usedInSubclass() → void { | |
16 core::print("Unused"); | |
17 } | |
18 method calledFromB() → void { | |
19 this.calledFromSubclass(); | |
20 } | |
21 method calledFromSubclass() → void { | |
22 core::print("Unused"); | |
23 } | |
24 } | |
25 class UsedAsInterface extends core::Object { | |
26 constructor •() → void | |
27 : super core::Object::•() | |
28 ; | |
29 method usedInSubclass() → void { | |
30 core::print("Unused"); | |
31 } | |
32 } | |
33 class InstantiatedButMethodsUnused extends core::Object { | |
34 constructor •() → void | |
35 : super core::Object::•() | |
36 ; | |
37 method usedInSubclass() → void { | |
38 core::print("Unused"); | |
39 } | |
40 } | |
41 class ClassA extends self::UsedAsBaseClass implements self::UsedAsInterface, sel
f::InstantiatedButMethodsUnused { | |
42 constructor •() → void | |
43 : super self::UsedAsBaseClass::•() | |
44 ; | |
45 method usedInSubclass() → void { | |
46 core::print("A"); | |
47 } | |
48 } | |
49 class ClassB extends self::UsedAsBaseClass implements self::UsedAsInterface, sel
f::InstantiatedButMethodsUnused { | |
50 constructor •() → void | |
51 : super self::UsedAsBaseClass::•() | |
52 ; | |
53 method usedInSubclass() → void { | |
54 core::print("B"); | |
55 this.calledFromB(); | |
56 } | |
57 method calledFromSubclass() → void {} | |
58 } | |
59 static method baseClassCall(self::UsedAsBaseClass object) → void { | |
60 object.usedInSubclass(); | |
61 } | |
62 static method interfaceCall(self::UsedAsInterface object) → void { | |
63 object.usedInSubclass(); | |
64 } | |
65 static method exactCallA(self::ClassA object) → void { | |
66 object.usedInSubclass(); | |
67 } | |
68 static method exactCallB(self::ClassB object) → void { | |
69 object.usedInSubclass(); | |
70 } | |
71 static method unusedTopLevel() → dynamic { | |
72 core::print("Unused"); | |
73 } | |
74 static method usedTopLevel() → dynamic {} | |
75 static method main() → dynamic { | |
76 self::usedTopLevel(); | |
77 self::ClassA a = new self::ClassA::•(); | |
78 self::exactCallA(a); | |
79 self::baseClassCall(a); | |
80 self::interfaceCall(a); | |
81 self::ClassB b = new self::ClassB::•(); | |
82 self::exactCallB(b); | |
83 self::baseClassCall(b); | |
84 self::interfaceCall(b); | |
85 new self::InstantiatedButMethodsUnused::•(); | |
86 } | |
OLD | NEW |