OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // VMOptions=--enable_type_checks | 4 // VMOptions=--enable_type_checks |
5 // | 5 // |
6 // Dart test for function type alias. | 6 // Dart test for function type alias. |
7 | 7 |
8 import "package:expect/expect.dart"; | |
9 | |
10 typedef Fun(a, b); | 8 typedef Fun(a, b); |
11 | 9 |
12 typedef int IntFun(a, b); | 10 typedef int IntFun(a, b); |
13 | 11 |
14 typedef bool BoolFun(a, b); | 12 typedef bool BoolFun(a, b); |
15 | 13 |
16 typedef int CompareObj(Object a, Object b); | 14 typedef int CompareObj(Object a, Object b); |
17 | 15 |
18 typedef int CompareInt(int a, int b); | 16 typedef int CompareInt(int a, int b); |
19 | 17 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 Function boundsTrue = (int arg) { }; | 99 Function boundsTrue = (int arg) { }; |
102 Function boundsFalse = (String arg) { }; | 100 Function boundsFalse = (String arg) { }; |
103 Expect.isTrue(boundsTrue is BoundsCheck<num>); | 101 Expect.isTrue(boundsTrue is BoundsCheck<num>); |
104 Expect.isFalse(boundsFalse is BoundsCheck<num>); | 102 Expect.isFalse(boundsFalse is BoundsCheck<num>); |
105 } | 103 } |
106 } | 104 } |
107 | 105 |
108 main() { | 106 main() { |
109 FunctionTypeAliasTest.testMain(); | 107 FunctionTypeAliasTest.testMain(); |
110 } | 108 } |
OLD | NEW |