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

Unified Diff: tests/lib/mirrors/metadata_scope_test.dart

Issue 269253005: Put metadata fields in their owner class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/object.cc ('K') | « tests/lib/lib.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/metadata_scope_test.dart
diff --git a/tests/lib/mirrors/metadata_scope_test.dart b/tests/lib/mirrors/metadata_scope_test.dart
index 2ccf39743eddfdafa02dbefc65d169945d1650d6..6fa070ed51aca01564724bac541e8be7a8200dde 100644
--- a/tests/lib/mirrors/metadata_scope_test.dart
+++ b/tests/lib/mirrors/metadata_scope_test.dart
@@ -16,7 +16,7 @@ class Annotation {
// Note there is no compile-time constant 'foo' in scope. In particular, A.foo
// is not in scope here.
@Annotation(foo) /// 01: compile-time error
-class A {
+class A <@Annotation(foo) T> {
@Annotation(foo)
static foo() {}
@@ -25,7 +25,7 @@ class A {
}
@Annotation(B.foo)
-class B {
+class B <@Annotation(B.foo) T> {
@Annotation(B.foo)
static foo() {}
@@ -37,7 +37,7 @@ baz() {}
// Note the top-level function baz is in scope here, not C.baz.
@Annotation(baz)
-class C {
+class C <@Annotation(baz) T> {
@Annotation(baz)
static baz() {}
}
@@ -48,13 +48,16 @@ checkMetadata(DeclarationMirror mirror, List expectedMetadata) {
main() {
reflectClass(A).metadata;
+ checkMetadata(reflectClass(A).declarations[#T], [const Annotation(A.foo)]);
checkMetadata(reflectClass(A).declarations[#foo], [const Annotation(A.foo)]);
checkMetadata(reflectClass(A).declarations[#bar], [const Annotation(A.foo)]);
checkMetadata(reflectClass(B), [const Annotation(B.foo)]);
+ checkMetadata(reflectClass(B).declarations[#T], [const Annotation(B.foo)]);
checkMetadata(reflectClass(B).declarations[#foo], [const Annotation(B.foo)]);
checkMetadata(reflectClass(B).declarations[#bar], [const Annotation(B.foo)]);
// The top-level function baz, not C.baz.
checkMetadata(reflectClass(C), [const Annotation(baz)]);
// C.baz, not the top-level function baz.
+ checkMetadata(reflectClass(C).declarations[#T], [const Annotation(C.baz)]);
checkMetadata(reflectClass(C).declarations[#baz], [const Annotation(C.baz)]);
}
« runtime/vm/object.cc ('K') | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698