Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Side by Side Diff: tests/language/metadata_test.dart

Issue 10912163: Fix metadata test in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Test ensuring that compiler can parse metadata. Need to add negative 5 // Test ensuring that compiler can parse metadata. Need to add negative
6 // test cases with illegal metadata annotations. 6 // test cases with illegal metadata annotations.
7 7
8 #import("metadata_lib.dart", prefix: "Meta"); 8 #import("metadata_lib.dart", prefix: "Meta");
9 9
10 class Tag { 10 class Tag {
11 final String annotation; 11 final String annotation;
12 const Tag(this.annotation); 12 const Tag(this.annotation);
13 } 13 }
14 14
15 const meta1 = 1; 15 const meta1 = 1;
16 const meta2 = const Tag("meta2"); 16 const meta2 = const Tag("meta2");
17 17
18 const extern = const Tag("external"); 18 const extern = const Tag("external");
19 19
20 @meta1 var topLevelVar; 20 @meta1 var topLevelVar;
21 @Meta.Alien.unspecified() List unknownUnknowns; 21 @Meta.Alien.unspecified() List unknownUnknowns;
22 22
23 @meta1 typedef int DingDong<@meta2 T>(@meta1 event); 23 @meta1 typedef int DingDong<@meta2 T>(@meta1 event);
24 24
25 @meta1 class A <@Tag("typeParam") T> { 25 @meta1 class A <@Tag("typeParam") T> {
26 @meta1 @meta2 26 @meta1 @meta2
27 static String staticField; 27 static String staticField;
28 28
29 @Meta.Alien("ET") void foo(@meta1 bool fool, {@meta1 @Tag("opt") x: 100}) { 29 @Meta.Alien("ET") int foo(@meta1 bool fool, {@meta1 @Tag("opt") x: 100}) {
30 return x; 30 return x;
31 } 31 }
32 32
33 @Tag(@"timewarp") 33 @Tag(@"timewarp")
34 List<int> getNextWeeksLottoNumbers() => [1, 2, 3, 4, 5, 6]; 34 List<int> getNextWeeksLottoNumbers() => [1, 2, 3, 4, 5, 6];
35 } 35 }
36 36
37 @meta1 main() { 37 @meta1 main() {
38 @meta1 var a = new A(); 38 @meta1 var a = new A();
39 Expect.equals(0, a.foo(false, x: 0)); 39 Expect.equals(0, a.foo(false, x: 0));
40 40
41 for (@Tag("loopvar") int i = 0; i < 10; i++) { 41 for (@Tag("loopvar") int i = 0; i < 10; i++) {
42 // Do something. 42 // Do something.
43 } 43 }
44 44
45 @meta1 var s = @'This is a raw \\ string.'; 45 @meta1 var s = @'This is a raw \\ string.';
46 } 46 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698