OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import "mixin_lib_extends_method_lib.dart" as L; |
| 6 |
| 7 class S { |
| 8 foo() => "S-foo"; |
| 9 baz() => "S-baz"; |
| 10 } |
| 11 |
| 12 class C extends S with L.M1 { } |
| 13 class D extends S with L.M1, L.M2 { } |
| 14 class E extends S with L.M2, L.M1 { } |
| 15 |
| 16 class F extends E { |
| 17 fez() => "F-fez"; |
| 18 } |
| 19 |
| 20 main() { |
| 21 var c = new C(); |
| 22 Expect.equals("S-foo", c.foo()); |
| 23 Expect.equals("M1-bar", c.bar()); |
| 24 Expect.equals("S-baz", c.baz()); |
| 25 Expect.throws(() => c.fez(), (error) => error is NoSuchMethodError); |
| 26 Expect.equals("sugus", c.clo("su")("gus")); |
| 27 |
| 28 var d = new D(); |
| 29 Expect.equals("S-foo", d.foo()); |
| 30 Expect.equals("M2-bar", d.bar()); |
| 31 Expect.equals("M2-baz", d.baz()); |
| 32 Expect.equals("M2-fez", d.fez()); |
| 33 Expect.equals("sugus", d.clo("su")("gus")); |
| 34 |
| 35 var e = new E(); |
| 36 Expect.equals("S-foo", e.foo()); |
| 37 Expect.equals("M1-bar", e.bar()); |
| 38 Expect.equals("M2-baz", e.baz()); |
| 39 Expect.equals("M2-fez", e.fez()); |
| 40 Expect.equals("sugus", e.clo("su")("gus")); |
| 41 |
| 42 var f = new F(); |
| 43 Expect.equals("S-foo", f.foo()); |
| 44 Expect.equals("M1-bar", f.bar()); |
| 45 Expect.equals("M2-baz", f.baz()); |
| 46 Expect.equals("F-fez", f.fez()); |
| 47 Expect.equals("sugus", f.clo("su")("gus")); |
| 48 } |
OLD | NEW |