OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Dart test for legally self referencing function type alias. | 4 // Dart test for legally self referencing function type alias. |
5 | 5 |
6 import "package:expect/expect.dart"; | |
7 | |
8 typedef F(List<F> x); | 6 typedef F(List<F> x); |
9 | 7 |
10 typedef D C(); | 8 typedef D C(); |
11 | 9 |
12 class D { | 10 class D { |
13 C foo() { } | 11 C foo() { } |
14 D bar() { } | 12 D bar() { } |
15 } | 13 } |
16 | 14 |
17 main() { | 15 main() { |
18 var f = (List x) { }; | 16 var f = (List x) { }; |
19 Expect.isTrue(f is F); | 17 Expect.isTrue(f is F); |
20 var g = (List<F> x) { }; | 18 var g = (List<F> x) { }; |
21 Expect.isTrue(g is F); | 19 Expect.isTrue(g is F); |
22 var d = new D(); | 20 var d = new D(); |
23 Expect.isTrue(d.foo is !C); | 21 Expect.isTrue(d.foo is !C); |
24 Expect.isTrue(d.bar is C); | 22 Expect.isTrue(d.bar is C); |
25 } | 23 } |
OLD | NEW |