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