| 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 // Test that is is an error to use type arguments in metadata without | |
| 8 // parens. | |
| 9 | |
| 10 @Bar() | |
| 11 @List<String> /// 01: compile-time error | |
| 12 class Bar { | |
| 13 @Bar() | |
| 14 @List<String> /// 02: compile-time error | |
| 15 const Bar(); | |
| 16 | |
| 17 @Bar() | |
| 18 @List<String> /// 03: compile-time error | |
| 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'; | |
| 29 } | |
| 30 | |
| 31 main() { | |
| 32 Expect.equals('x', new 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); | |
| 42 } | |
| OLD | NEW |