| Index: pkg/compiler/lib/src/resolution/variables.dart
|
| diff --git a/pkg/compiler/lib/src/resolution/variables.dart b/pkg/compiler/lib/src/resolution/variables.dart
|
| index 6f22eed3214167ac8b1f69657f4b30f15930e2b8..aec67f3afdf3d20e9bbd105ed962184c4e2af013 100644
|
| --- a/pkg/compiler/lib/src/resolution/variables.dart
|
| +++ b/pkg/compiler/lib/src/resolution/variables.dart
|
| @@ -60,11 +60,16 @@ class VariableDefinitionsVisitor extends CommonResolverVisitor<Identifier> {
|
| registry.registerTypeUse(
|
| new TypeUse.instantiation(compiler.coreTypes.nullType));
|
| if (definitions.modifiers.isConst) {
|
| - reporter.reportErrorMessage(
|
| - node, MessageKind.CONST_WITHOUT_INITIALIZER);
|
| + if (resolver.inLoopVariable) {
|
| + reporter.reportErrorMessage(
|
| + node, MessageKind.CONST_LOOP_VARIABLE);
|
| + } else {
|
| + reporter.reportErrorMessage(
|
| + node, MessageKind.CONST_WITHOUT_INITIALIZER);
|
| + }
|
| }
|
| if (definitions.modifiers.isFinal &&
|
| - !resolver.allowFinalWithoutInitializer) {
|
| + !resolver.inLoopVariable) {
|
| reporter.reportErrorMessage(
|
| node, MessageKind.FINAL_WITHOUT_INITIALIZER);
|
| }
|
|
|