OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017, 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 class I1 { | |
Paul Berry
2017/08/26 14:53:44
Whoops, I forgot to mark I1 and I2 as "abstract".
| |
6 void f(int i); | |
7 } | |
8 | |
9 class I2 { | |
10 void f(Object o); | |
11 } | |
12 | |
13 abstract class C implements I1, I2 {} | |
14 | |
15 class D extends C { | |
16 void f(Object o) {} | |
17 } | |
18 | |
19 abstract class E implements I2, I1 {} | |
Jennifer Messerly
2017/08/26 00:24:16
oh wow -- so the analyzer analysis depends on the
Paul Berry
2017/08/26 14:53:44
Actually, it's the other way round. E works but C
| |
20 | |
21 class F extends E { | |
22 void f(Object o) {} | |
23 } | |
24 | |
25 void g1(C c) { | |
26 c.f('hi'); | |
27 } | |
28 | |
29 void g2(E e) { | |
30 e.f('hi'); | |
31 } | |
32 | |
33 main() { | |
34 g1(new D()); | |
35 g2(new F()); | |
36 } | |
OLD | NEW |