| 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 class S { | 7 class S { |
| 8 foo() => "S-foo"; | 8 foo() => "S-foo"; |
| 9 baz() => "S-baz"; | 9 baz() => "S-baz"; |
| 10 } | 10 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 class D extends S with M1, M2 {} | 25 class D extends S with M1, M2 {} |
| 26 | 26 |
| 27 class E extends S with M2, M1 {} | 27 class E extends S with M2, M1 {} |
| 28 | 28 |
| 29 class F extends E { | 29 class F extends E { |
| 30 fez() => "F-fez"; | 30 fez() => "F-fez"; |
| 31 } | 31 } |
| 32 | 32 |
| 33 main() { | 33 main() { |
| 34 var c = new C(); | 34 dynamic c = new C(); |
| 35 Expect.equals("S-foo", c.foo()); | 35 Expect.equals("S-foo", c.foo()); |
| 36 Expect.equals("M1-bar", c.bar()); | 36 Expect.equals("M1-bar", c.bar()); |
| 37 Expect.equals("S-baz", c.baz()); | 37 Expect.equals("S-baz", c.baz()); |
| 38 Expect.throws(() => c.fez(), (error) => error is NoSuchMethodError); | 38 Expect.throws(() => c.fez(), (error) => error is NoSuchMethodError); |
| 39 | 39 |
| 40 var d = new D(); | 40 var d = new D(); |
| 41 Expect.equals("S-foo", d.foo()); | 41 Expect.equals("S-foo", d.foo()); |
| 42 Expect.equals("M2-bar", d.bar()); | 42 Expect.equals("M2-bar", d.bar()); |
| 43 Expect.equals("M2-baz", d.baz()); | 43 Expect.equals("M2-baz", d.baz()); |
| 44 Expect.equals("M2-fez", d.fez()); | 44 Expect.equals("M2-fez", d.fez()); |
| 45 | 45 |
| 46 var e = new E(); | 46 var e = new E(); |
| 47 Expect.equals("S-foo", e.foo()); | 47 Expect.equals("S-foo", e.foo()); |
| 48 Expect.equals("M1-bar", e.bar()); | 48 Expect.equals("M1-bar", e.bar()); |
| 49 Expect.equals("M2-baz", e.baz()); | 49 Expect.equals("M2-baz", e.baz()); |
| 50 Expect.equals("M2-fez", e.fez()); | 50 Expect.equals("M2-fez", e.fez()); |
| 51 | 51 |
| 52 var f = new F(); | 52 var f = new F(); |
| 53 Expect.equals("S-foo", f.foo()); | 53 Expect.equals("S-foo", f.foo()); |
| 54 Expect.equals("M1-bar", f.bar()); | 54 Expect.equals("M1-bar", f.bar()); |
| 55 Expect.equals("M2-baz", f.baz()); | 55 Expect.equals("M2-baz", f.baz()); |
| 56 Expect.equals("F-fez", f.fez()); | 56 Expect.equals("F-fez", f.fez()); |
| 57 } | 57 } |
| OLD | NEW |