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

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

Issue 1336303002: Avoid creating ConstructedConstantExpression for deferred constant. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 5 years, 3 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 | no next file » | 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 db8ae1c51e056d9d28a0456a2af0df5b96d1ce41..c1263d061a82db7f85e3c3e6b644ca520525fa3c 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -3893,6 +3893,21 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
}
if (node.isConst) {
analyzeConstantDeferred(node);
+
+ // TODO(johnniwinther): Compute this in the [ConstructorResolver].
+ // Check that the constructor is not deferred.
+ Send send = node.send.selector.asSend();
+ if (send != null) {
+ // Of the form `const a.b(...)`.
+ if (compiler.deferredLoadTask.deferredPrefixElement(
+ send, registry.mapping) != null) {
+ // `a` is a deferred prefix.
+ isValidAsConstant = false;
+ // TODO(johnniwinther): Create an [ErroneousConstantExpression] here
+ // when constants are only created during resolution.
+ }
+ }
+
if (isValidAsConstant &&
constructor.isConst &&
argumentsResult.isValidAsConstant) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698