OLD | NEW |
---|---|
(Empty) | |
1 import 'package:expect/expect.dart'; | |
Jennifer Messerly
2017/06/19 20:24:52
this needs a copyright notice
alternatively, I th
vsm
2017/06/19 20:36:20
Done.
| |
2 | |
3 int invoke(int f()) => f(); | |
4 | |
5 class A { | |
6 int foo() { | |
7 return 42; | |
8 } | |
9 } | |
10 | |
11 class B extends A { | |
12 int x; | |
13 | |
14 B() { | |
15 x = invoke(super.foo); | |
16 } | |
17 | |
18 int foo() { | |
19 return -1; | |
20 } | |
21 } | |
22 | |
23 void main() { | |
24 var b = new B(); | |
25 Expect.equals(42, b.x); | |
26 } | |
OLD | NEW |