OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library test.metadata_allowed_values; | 5 library test.metadata_allowed_values; |
6 | 6 |
7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 | 9 |
10 import 'metadata_allowed_values_import.dart'; // Unprefixed. | 10 import 'metadata_allowed_values_import.dart'; // Unprefixed. |
11 import 'metadata_allowed_values_import.dart' as prefix; | 11 import 'metadata_allowed_values_import.dart' as prefix; |
12 | 12 |
13 @A // //# 01: compile-time error | 13 @A // //# 01: compile-time error |
14 class A {} | 14 class A {} |
15 | 15 |
16 @B.CONSTANT | 16 @B.CONSTANT |
17 class B { | 17 class B { |
18 static const CONSTANT = 3; | 18 static const CONSTANT = 3; |
19 } | 19 } |
20 | 20 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 @true // //# 23: compile-time error | 130 @true // //# 23: compile-time error |
131 class FF {} | 131 class FF {} |
132 | 132 |
133 @false // //# 24: compile-time error | 133 @false // //# 24: compile-time error |
134 class GG {} | 134 class GG {} |
135 | 135 |
136 @null // //# 25: compile-time error | 136 @null // //# 25: compile-time error |
137 class HH {} | 137 class HH {} |
138 | 138 |
139 const a = const [1, 2, 3]; | 139 const a = const [1, 2, 3]; |
140 | |
141 @a | 140 @a |
142 class II {} | 141 class II {} |
143 | 142 |
144 @a[0] // //# 26: compile-time error | 143 @a[0] // //# 26: compile-time error |
145 class JJ {} | 144 class JJ {} |
146 | 145 |
147 @kk // //# 27: compile-time error | 146 @kk // //# 27: compile-time error |
148 class KK { | 147 class KK { |
149 const KK(); | 148 const KK(); |
150 } | 149 } |
151 | |
152 get kk => const KK(); | 150 get kk => const KK(); |
153 | 151 |
154 @LL(() => 42) // //# 28: compile-time error | 152 @LL(() => 42) // //# 28: compile-time error |
155 class LL { | 153 class LL { |
156 final field; | 154 final field; |
157 const LL(this.field); | 155 const LL(this.field); |
158 } | 156 } |
159 | 157 |
160 @MM((x) => 42) // //# 29: compile-time error | 158 @MM((x) => 42) // //# 29: compile-time error |
161 class MM { | 159 class MM { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 reflectClass(GG).metadata; | 213 reflectClass(GG).metadata; |
216 reflectClass(HH).metadata; | 214 reflectClass(HH).metadata; |
217 reflectClass(II).metadata; | 215 reflectClass(II).metadata; |
218 reflectClass(JJ).metadata; | 216 reflectClass(JJ).metadata; |
219 reflectClass(KK).metadata; | 217 reflectClass(KK).metadata; |
220 reflectClass(LL).metadata; | 218 reflectClass(LL).metadata; |
221 reflectClass(MM).metadata; | 219 reflectClass(MM).metadata; |
222 reflectClass(NN).metadata; | 220 reflectClass(NN).metadata; |
223 reflectClass(OO).metadata; | 221 reflectClass(OO).metadata; |
224 } | 222 } |
OLD | NEW |