Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
index 4387ef1168e5dcc830d21f94f599e86cf1123b0e..c14b895f913c259c8f5d0cab67c812e26c154548 100644 |
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
@@ -736,6 +736,21 @@ class ResolverTask extends CompilerTask { |
for (MetadataAnnotation metadata in element.metadata) { |
metadata.ensureResolved(compiler); |
} |
+ |
+ // Force resolution of metadata on non-instance members since they may be |
+ // inspected by the backend while emitting. Metadata on instance members is |
+ // handled as a result of processing instantiated class members in the |
+ // enqueuer. |
+ // TODO(ahe): Avoid this eager resolution. |
+ element.forEachMember((_, Element member) { |
+ if (!member.isInstanceMember()) { |
+ compiler.withCurrentElement(member, () { |
+ for (MetadataAnnotation metadata in member.metadata) { |
+ metadata.ensureResolved(compiler); |
+ } |
+ }); |
+ } |
+ }); |
} |
void checkClass(ClassElement element) { |