OLD | NEW |
| (Empty) |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE.md file. | |
4 | |
5 // TODO(ahe): This is a copy of [rasta/super.dart] without the `n` | |
6 // property. Remove this once fasta can handle all of the original file. | |
7 | |
8 class A { | |
9 var a; | |
10 var b; | |
11 var c; | |
12 var d; | |
13 get e => null; | |
14 final f; | |
15 set g(_) {} | |
16 get h => null; | |
17 set h(_) {} | |
18 get i => null; | |
19 | |
20 operator [](_) => null; | |
21 operator []=(a, b) {} | |
22 operator ~() => 117; | |
23 operator -() => 117; | |
24 | |
25 operator ==(other) => true; | |
26 | |
27 void m() {} | |
28 } | |
29 | |
30 class B extends A { | |
31 get b => null; | |
32 set c(x) {} | |
33 final d; | |
34 set i(x) {} | |
35 } | |
36 | |
37 class C extends B { | |
38 test() { | |
39 ~super; | |
40 use(~super); | |
41 -super; | |
42 use(-super); | |
43 super == 87; | |
44 use(super == 87); | |
45 super != 87; | |
46 use(super != 87); | |
47 | |
48 super.a; | |
49 use(super.a); | |
50 super.b; | |
51 use(super.b); | |
52 super.c; | |
53 use(super.c); | |
54 super.d; | |
55 use(super.d); | |
56 super.e; | |
57 use(super.e); | |
58 super.f; | |
59 use(super.f); | |
60 super.g; | |
61 use(super.g); | |
62 super.h; | |
63 use(super.h); | |
64 super.i; | |
65 use(super.i); | |
66 super[87]; | |
67 use(super[87]); | |
68 super.m; | |
69 use(super.m); | |
70 | |
71 super.a++; | |
72 use(super.a++); | |
73 super.b++; | |
74 use(super.b++); | |
75 super.c++; | |
76 use(super.c++); | |
77 super.d++; | |
78 use(super.d++); | |
79 super.e++; | |
80 use(super.e++); | |
81 super.f++; | |
82 use(super.f++); | |
83 super.g++; | |
84 use(super.g++); | |
85 super.h++; | |
86 use(super.h++); | |
87 super.i++; | |
88 use(super.i++); | |
89 super[87]++; | |
90 use(super[87]++); | |
91 super.m++; | |
92 use(super.m++); | |
93 | |
94 ++super.a; | |
95 use(++super.a); | |
96 ++super.b; | |
97 use(++super.b); | |
98 ++super.c; | |
99 use(++super.c); | |
100 ++super.d; | |
101 use(++super.d); | |
102 ++super.e; | |
103 use(++super.e); | |
104 ++super.f; | |
105 use(++super.f); | |
106 ++super.g; | |
107 use(++super.g); | |
108 ++super.h; | |
109 use(++super.h); | |
110 ++super.i; | |
111 use(++super.i); | |
112 ++super[87]; | |
113 use(++super[87]); | |
114 ++super.m; | |
115 use(++super.m); | |
116 | |
117 super.a(); | |
118 use(super.a()); | |
119 super.b(); | |
120 use(super.b()); | |
121 super.c(); | |
122 use(super.c()); | |
123 super.d(); | |
124 use(super.d()); | |
125 super.e(); | |
126 use(super.e()); | |
127 super.f(); | |
128 use(super.f()); | |
129 super.g(); | |
130 use(super.g()); | |
131 super.h(); | |
132 use(super.h()); | |
133 super.i(); | |
134 use(super.i()); | |
135 super[87](); | |
136 use(super[87]()); | |
137 super.m(); | |
138 use(super.m()); | |
139 super.m(87); | |
140 use(super.m(87)); | |
141 | |
142 super.a = 42; | |
143 use(super.a = 42); | |
144 super.b = 42; | |
145 use(super.b = 42); | |
146 super.c = 42; | |
147 use(super.c = 42); | |
148 super.d = 42; | |
149 use(super.d = 42); | |
150 super.e = 42; | |
151 use(super.e = 42); | |
152 super.f = 42; | |
153 use(super.f = 42); | |
154 super.g = 42; | |
155 use(super.g = 42); | |
156 super.h = 42; | |
157 use(super.h = 42); | |
158 super.i = 42; | |
159 use(super.i = 42); | |
160 super[87] = 42; | |
161 use(super[87] = 42); | |
162 super.m = 42; | |
163 use(super.m = 42); | |
164 | |
165 super.a ??= 42; | |
166 use(super.a ??= 42); | |
167 super.b ??= 42; | |
168 use(super.b ??= 42); | |
169 super.c ??= 42; | |
170 use(super.c ??= 42); | |
171 super.d ??= 42; | |
172 use(super.d ??= 42); | |
173 super.e ??= 42; | |
174 use(super.e ??= 42); | |
175 super.f ??= 42; | |
176 use(super.f ??= 42); | |
177 super.g ??= 42; | |
178 use(super.g ??= 42); | |
179 super.h ??= 42; | |
180 use(super.h ??= 42); | |
181 super.i ??= 42; | |
182 use(super.i ??= 42); | |
183 super[87] ??= 42; | |
184 use(super[87] ??= 42); | |
185 super.m ??= 42; | |
186 use(super.m ??= 42); | |
187 | |
188 super.a += 42; | |
189 use(super.a += 42); | |
190 super.b += 42; | |
191 use(super.b += 42); | |
192 super.c += 42; | |
193 use(super.c += 42); | |
194 super.d += 42; | |
195 use(super.d += 42); | |
196 super.e += 42; | |
197 use(super.e += 42); | |
198 super.f += 42; | |
199 use(super.f += 42); | |
200 super.g += 42; | |
201 use(super.g += 42); | |
202 super.h += 42; | |
203 use(super.h += 42); | |
204 super.i += 42; | |
205 use(super.i += 42); | |
206 super[87] += 42; | |
207 use(super[87] += 42); | |
208 super.m += 42; | |
209 use(super.m += 42); | |
210 | |
211 super.a -= 42; | |
212 use(super.a -= 42); | |
213 super.b -= 42; | |
214 use(super.b -= 42); | |
215 super.c -= 42; | |
216 use(super.c -= 42); | |
217 super.d -= 42; | |
218 use(super.d -= 42); | |
219 super.e -= 42; | |
220 use(super.e -= 42); | |
221 super.f -= 42; | |
222 use(super.f -= 42); | |
223 super.g -= 42; | |
224 use(super.g -= 42); | |
225 super.h -= 42; | |
226 use(super.h -= 42); | |
227 super.i -= 42; | |
228 use(super.i -= 42); | |
229 super[87] -= 42; | |
230 use(super[87] -= 42); | |
231 super.m -= 42; | |
232 use(super.m -= 42); | |
233 } | |
234 } | |
235 | |
236 use(x) { | |
237 if (x == new DateTime.now().millisecondsSinceEpoch) throw "Shouldn't happen"; | |
238 } | |
239 | |
240 main() { | |
241 try { | |
242 new C().test(); | |
243 } on NoSuchMethodError { | |
244 return; // Test passed. | |
245 } | |
246 throw "Test failed"; | |
247 } | |
OLD | NEW |