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

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

Issue 2896393003: Remove factory body in *.fromEnvironment, and implement this same behavior (Closed)
Patch Set: turn warning into a hint Created 3 years, 7 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/kernel/kernel_visitor.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 307240b98966eaf09b7f6e80dda841c46b0976aa..2b9f78860afaf4033c62ff590afba3565db73224 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -3851,6 +3851,14 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
argumentsResult =
inConstantContext(() => resolveArguments(node.send.argumentsNode));
} else {
+ if (!node.isConst && constructor.isFromEnvironmentConstructor) {
+ // TODO(sigmund): consider turning this into a compile-time-error.
+ reporter.reportHintMessage(
+ node,
+ MessageKind.FROM_ENVIRONMENT_MUST_BE_CONST,
+ {'className': constructor.enclosingClass.name});
+ registry.registerFeature(Feature.THROW_UNSUPPORTED_ERROR);
+ }
argumentsResult = resolveArguments(node.send.argumentsNode);
}
// TODO(johnniwinther): Avoid the need for a [Selector].
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_visitor.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698