OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library mixin_lib_extends_field_test; | 5 library mixin_lib_extends_field_test; |
6 | 6 |
7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
8 import "mixin_lib_extends_field_lib.dart" as L; | 8 import "mixin_lib_extends_field_lib.dart" as L; |
9 | 9 |
10 class S { | 10 class S { |
11 var foo = "S-foo"; | 11 var foo = "S-foo"; |
12 } | 12 } |
13 | 13 |
14 class C extends S with L.M1 {} | 14 class C extends S with L.M1 {} |
15 | 15 |
16 class D extends S with L.M1, L.M2 {} | 16 class D extends S with L.M1, L.M2 {} |
17 | 17 |
18 class E extends S with L.M2, L.M1 {} | 18 class E extends S with L.M2, L.M1 {} |
19 | 19 |
20 class F extends E { | 20 class F extends E { |
21 var fez = "F-fez"; | 21 var fez = "F-fez"; |
22 } | 22 } |
23 | 23 |
24 main() { | 24 main() { |
25 var c = new C(); | 25 dynamic c = new C(); |
26 var d = new D(); | 26 dynamic d = new D(); |
27 var e = new E(); | 27 dynamic e = new E(); |
28 var f = new F(); | 28 dynamic f = new F(); |
29 | 29 |
30 Expect.equals("S-foo", c.foo); | 30 Expect.equals("S-foo", c.foo); |
31 Expect.equals("S-foo", d.foo); | 31 Expect.equals("S-foo", d.foo); |
32 Expect.equals("S-foo", e.foo); | 32 Expect.equals("S-foo", e.foo); |
33 Expect.equals("S-foo", f.foo); | 33 Expect.equals("S-foo", f.foo); |
34 | 34 |
35 Expect.equals("M1-bar", c.bar); | 35 Expect.equals("M1-bar", c.bar); |
36 Expect.equals("M1-bar", d.bar); | 36 Expect.equals("M1-bar", d.bar); |
37 Expect.equals("M1-bar", e.bar); | 37 Expect.equals("M1-bar", e.bar); |
38 Expect.equals("M1-bar", f.bar); | 38 Expect.equals("M1-bar", f.bar); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 Expect.throws(() => c.fez = 0, (error) => error is NoSuchMethodError); | 108 Expect.throws(() => c.fez = 0, (error) => error is NoSuchMethodError); |
109 Expect.throws(() => d.fez = 0, (error) => error is NoSuchMethodError); | 109 Expect.throws(() => d.fez = 0, (error) => error is NoSuchMethodError); |
110 Expect.throws(() => e.fez = 0, (error) => error is NoSuchMethodError); | 110 Expect.throws(() => e.fez = 0, (error) => error is NoSuchMethodError); |
111 | 111 |
112 f.fez = "F-fez-f"; | 112 f.fez = "F-fez-f"; |
113 Expect.throws(() => c.fez, (error) => error is NoSuchMethodError); | 113 Expect.throws(() => c.fez, (error) => error is NoSuchMethodError); |
114 Expect.throws(() => d.fez, (error) => error is NoSuchMethodError); | 114 Expect.throws(() => d.fez, (error) => error is NoSuchMethodError); |
115 Expect.throws(() => e.fez, (error) => error is NoSuchMethodError); | 115 Expect.throws(() => e.fez, (error) => error is NoSuchMethodError); |
116 Expect.equals("F-fez-f", f.fez); | 116 Expect.equals("F-fez-f", f.fez); |
117 } | 117 } |
OLD | NEW |