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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 11299009: Support type literals as compile-time constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
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 af90b8e4dd1e9bdff3b6365c4455809e0ec2525a..2387f3a652da2423fa4fb6f97eef0194257a23b3 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -1537,7 +1537,17 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
return compiler.assertMethod;
}
- return node.selector.accept(this);
+ Element result = node.selector.accept(this);
+ if (Elements.isClass(result)) {
+ // If we use a class literal in a constant, the compile time constant
ngeoffray 2012/11/15 16:07:24 I think you should move that to the compile time c
karlklose 2012/11/19 15:08:58 Done.
+ // emitter will generate a call to the runtime type cache helper, so we
+ // resolve it and put it into the codegen work list.
+ SourceString helperName = const SourceString('createRuntimeType');
+ Element helper = compiler.findHelper(helperName);
+ compiler.enqueuer.resolution.addToWorkList(helper);
+ compiler.enqueuer.codegen.addToWorkList(helper);
+ }
+ return result;
}
var oldCategory = allowedCategory;

Powered by Google App Engine
This is Rietveld 408576698