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

Side by Side Diff: tests/lib/mirrors/metadata_constructor_arguments_test.dart

Issue 76963003: Fix crash evaluating metadata with super in a const constructor argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « runtime/vm/parser.cc ('k') | 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) 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 // Regression test for Issue 13817. 5 // Regression test for Issue 13817.
6 6
7 library test.metadata_constructor_arguments; 7 library test.metadata_constructor_arguments;
8 8
9 import 'dart:mirrors'; 9 import 'dart:mirrors';
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 27 matching lines...) Expand all
38 @Tag(named: F.nonConstStaticField) /// 04: compile-time error 38 @Tag(named: F.nonConstStaticField) /// 04: compile-time error
39 class F { 39 class F {
40 static var nonConstStaticField = 6; 40 static var nonConstStaticField = 6;
41 } 41 }
42 42
43 @Tag(named: instanceMethod) /// 05: compile-time error 43 @Tag(named: instanceMethod) /// 05: compile-time error
44 class G { 44 class G {
45 instanceMethod() {} 45 instanceMethod() {}
46 } 46 }
47 47
48 @Tag(named: this) /// 06: compile-time error
49 class H {
50 instanceMethod() {}
51 }
52
53 @Tag(named: super) /// 07: compile-time error
54 class I {
55 instanceMethod() {}
56 }
57
48 checkMetadata(DeclarationMirror mirror, List expectedMetadata) { 58 checkMetadata(DeclarationMirror mirror, List expectedMetadata) {
49 Expect.listEquals(expectedMetadata.map(reflect).toList(), mirror.metadata); 59 Expect.listEquals(expectedMetadata.map(reflect).toList(), mirror.metadata);
50 } 60 }
51 61
52 main() { 62 main() {
53 reflectClass(A).metadata; 63 reflectClass(A).metadata;
54 checkMetadata(reflectClass(B), [const Tag(named: 'valid')]); 64 checkMetadata(reflectClass(B), [const Tag(named: 'valid')]);
55 checkMetadata(reflectClass(C), [const Tag(named: C.STATIC_FIELD)]); 65 checkMetadata(reflectClass(C), [const Tag(named: C.STATIC_FIELD)]);
56 reflectClass(D).metadata; 66 reflectClass(D).metadata;
57 reflectClass(E).metadata; 67 reflectClass(E).metadata;
58 reflectClass(F).metadata; 68 reflectClass(F).metadata;
59 reflectClass(G).metadata; 69 reflectClass(G).metadata;
70 reflectClass(H).metadata;
71 reflectClass(I).metadata;
60 } 72 }
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698