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]. |