| 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 | 4 |
| 5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 // Test that is is an error to use type arguments in metadata without | 7 // Test that is is an error to use type arguments in metadata without |
| 8 // parens. | 8 // parens. |
| 9 | 9 |
| 10 @Bar() | 10 @Bar() |
| 11 @List<String> /// 01: compile-time error | 11 @List<String> /// 01: compile-time error |
| 12 class Bar { | 12 class Bar { |
| 13 @Bar() | 13 @Bar() |
| 14 @List<String> /// 02: compile-time error | 14 @List<String> /// 02: compile-time error |
| 15 const Bar(); | 15 const Bar(); |
| 16 | 16 |
| 17 @Bar() | 17 @Bar() |
| 18 @List<String> /// 03: compile-time error | 18 @List<String> /// 03: compile-time error |
| 19 final x = ''; | 19 final x = 'x'; |
| 20 |
| 21 @unknown /// 04: compile-time error |
| 22 final y = 'y'; |
| 23 |
| 24 @Bar /// 05: compile-time error |
| 25 final z = 'z'; |
| 26 |
| 27 @1234 /// 06: compile-time error |
| 28 final w = 'w'; |
| 20 } | 29 } |
| 21 | 30 |
| 22 main() { | 31 main() { |
| 23 Expect.equals('', new Bar().x); | 32 Expect.equals('x', new Bar().x); |
| 24 Expect.equals('', const Bar().x); | 33 Expect.equals('x', const Bar().x); |
| 34 Expect.equals('y', new Bar().y); |
| 35 Expect.equals('y', const Bar().y); |
| 36 Expect.equals('z', new Bar().z); |
| 37 Expect.equals('z', const Bar().z); |
| 38 Expect.equals('z', new Bar().z); |
| 39 Expect.equals('z', const Bar().z); |
| 40 Expect.equals('w', new Bar().w); |
| 41 Expect.equals('w', const Bar().w); |
| 25 } | 42 } |
| OLD | NEW |