OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 // Dart test verifying that the parser does not confuse parameterized types with | |
6 // boolean expressions, since both contain '<'. | |
7 | |
8 class GenericSyntaxTest<B, C, D, E, F> { | |
9 GenericSyntaxTest() {} | |
10 | |
11 void foo(x1, x2, x3, x4, x5) { | |
12 Expect.equals(true, x1); | |
13 Expect.equals(3, x2); | |
14 Expect.equals(4, x3); | |
15 Expect.equals(5, x4); | |
16 Expect.equals(false, x5); | |
17 } | |
18 | |
19 void bar(x) { | |
20 Expect.equals(null, x()); | |
21 } | |
22 | |
23 test() { | |
24 var a = 1; | |
25 var b = 2; | |
26 var c = 3; | |
27 var d = 4; | |
28 var e = 5; | |
29 var f = 6; | |
30 var g = 7; | |
31 var h = null; | |
32 bar(A<B, C, D, E, F> g() { return h; }); // 'A<B' starts a generic type. | |
33 foo(a<b, c, d, e, f> g); // 'a<b' is a boolean function argument. | |
34 } | |
35 | |
36 static testMain() { | |
37 new GenericSyntaxTest().test(); | |
38 } | |
39 } | |
40 | |
41 interface A<B, C, D, E, F> { | |
42 } | |
43 | |
44 main() { | |
45 GenericSyntaxTest.testMain(); | |
46 } | |
OLD | NEW |