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

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

Issue 2049553002: check that Class and typedef refs are const (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | tests/co19/co19-dart2js.status » ('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 3658a7d8b8c30ebf30909d963c21450266e938ec..a012c9eeb570ea7569a3b50260883e662047fdf5 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -1996,17 +1996,15 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
// TODO(23998): Remove this when all information goes through
// the [SendStructure].
registry.setSelector(node, selector);
-
- // The node itself is not a constant but we register the selector (the
- // identifier that refers to the class/typedef) as a constant.
+
registry.useElement(node.selector, element);
- analyzeConstantDeferred(node.selector, enforceConst: false);
+ analyzeConstantDeferred(node.selector);
registry.registerSendStructure(
node, new InvokeStructure(semantics, selector));
return const NoneResult();
} else {
- analyzeConstantDeferred(node, enforceConst: false);
+ analyzeConstantDeferred(node);
registry.setConstant(node, semantics.constant);
registry.registerSendStructure(node, new GetStructure(semantics));
@@ -4000,9 +3998,9 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
}
}
- void analyzeConstant(Node node, {enforceConst: true}) {
- ConstantExpression constant = compiler.resolver.constantCompiler
- .compileNode(node, registry.mapping, enforceConst: enforceConst);
+ void analyzeConstant(Node node) {
+ ConstantExpression constant =
+ compiler.resolver.constantCompiler.compileNode(node, registry.mapping);
if (constant == null) {
assert(invariant(node, compiler.compilationFailed));
@@ -4015,10 +4013,9 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
}
}
- void analyzeConstantDeferred(Node node,
- {bool enforceConst: true, void onAnalyzed()}) {
+ void analyzeConstantDeferred(Node node, {void onAnalyzed()}) {
addDeferredAction(enclosingElement, () {
- analyzeConstant(node, enforceConst: enforceConst);
+ analyzeConstant(node);
if (onAnalyzed != null) {
onAnalyzed();
}
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698