| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, 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 // Verify that the individual variable declarations inside a variable | |
| 6 // declaration list are not allowed to be annotated with metadata. | |
| 7 | |
| 8 const annotation = null; | |
| 9 | |
| 10 var | |
| 11 @annotation //# 01: compile-time error | |
| 12 v1, | |
| 13 @annotation //# 02: compile-time error | |
| 14 v2; | |
| 15 | |
| 16 int | |
| 17 @annotation //# 03: compile-time error | |
| 18 v3, | |
| 19 @annotation //# 04: compile-time error | |
| 20 v4; | |
| 21 | |
| 22 class C { | |
| 23 var | |
| 24 @annotation //# 05: compile-time error | |
| 25 f1, | |
| 26 @annotation //# 06: compile-time error | |
| 27 f2; | |
| 28 | |
| 29 int | |
| 30 @annotation //# 07: compile-time error | |
| 31 f3, | |
| 32 @annotation //# 08: compile-time error | |
| 33 f4; | |
| 34 } | |
| 35 | |
| 36 use(x) => x; | |
| 37 | |
| 38 main() { | |
| 39 use(v1); | |
| 40 use(v2); | |
| 41 use(v3); | |
| 42 use(v4); | |
| 43 | |
| 44 C c = new C(); | |
| 45 use(c.f1); | |
| 46 use(c.f2); | |
| 47 use(c.f3); | |
| 48 use(c.f4); | |
| 49 | |
| 50 var | |
| 51 @annotation //# 09: compile-time error | |
| 52 l1, | |
| 53 @annotation //# 10: compile-time error | |
| 54 l2; | |
| 55 | |
| 56 int | |
| 57 @annotation //# 11: compile-time error | |
| 58 l3, | |
| 59 @annotation //# 12: compile-time error | |
| 60 l4; | |
| 61 | |
| 62 use(l1); | |
| 63 use(l2); | |
| 64 use(l3); | |
| 65 use(l4); | |
| 66 | |
| 67 for (var | |
| 68 @annotation //# 13: compile-time error | |
| 69 i1 = 0, | |
| 70 @annotation //# 14: compile-time error | |
| 71 i2 = 0;;) { | |
| 72 use(i1); | |
| 73 use(i2); | |
| 74 break; | |
| 75 } | |
| 76 | |
| 77 for (int | |
| 78 @annotation //# 15: compile-time error | |
| 79 i3 = 0, | |
| 80 @annotation //# 16: compile-time error | |
| 81 i4 = 0;;) { | |
| 82 use(i3); | |
| 83 use(i4); | |
| 84 break; | |
| 85 } | |
| 86 } | |
| OLD | NEW |