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

Unified Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 1109393012: Allow use of deferred type-literals in non-constant contexts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review Created 5 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/js_backend/type_variable_handler.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/members.dart
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index 22b8461ef349a4ab6ab54b7bc295341d52c0495b..986663e59f250e2d153f5702df440e6cb6b23744 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -2868,7 +2868,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
// Don't try to make constants of calls to type literals.
if (!node.isCall) {
- analyzeConstantDeferred(node);
+ analyzeConstantDeferred(node, enforceConst: false);
} else {
// The node itself is not a constant but we register the selector (the
// identifier that refers to the class/typedef) as a constant.
@@ -2878,7 +2878,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
// the type literal from the selector.
registry.useElement(node.selector, target);
}
- analyzeConstantDeferred(node.selector);
+ analyzeConstantDeferred(node.selector, enforceConst: false);
}
}
if (isPotentiallyMutableTarget(target)) {
@@ -3441,10 +3441,10 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
}
}
- void analyzeConstant(Node node) {
+ void analyzeConstant(Node node, {enforceConst: true}) {
ConstantExpression constant =
compiler.resolver.constantCompiler.compileNode(
- node, registry.mapping);
+ node, registry.mapping, enforceConst: enforceConst);
if (constant == null) {
assert(invariant(node, compiler.compilationFailed));
@@ -3476,9 +3476,9 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
}
}
- void analyzeConstantDeferred(Node node) {
+ void analyzeConstantDeferred(Node node, {bool enforceConst: true}) {
addDeferredAction(enclosingElement, () {
- analyzeConstant(node);
+ analyzeConstant(node, enforceConst: enforceConst);
});
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/type_variable_handler.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698