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 b69287a8af336faa19dc163e95e7f40bdcf4dc6b..e3df4f8bff87a5f9e0e13badb8a6a06b4e442a96 100644 |
--- a/pkg/compiler/lib/src/resolution/members.dart |
+++ b/pkg/compiler/lib/src/resolution/members.dart |
@@ -17,10 +17,10 @@ import '../dart_types.dart'; |
import '../elements/elements.dart'; |
import '../elements/modelx.dart' |
show |
- BaseFunctionElementX, |
ConstructorElementX, |
ErroneousElementX, |
FunctionElementX, |
+ InitializingFormalElementX, |
JumpTargetX, |
LocalFunctionElementX, |
LocalParameterElementX, |
@@ -444,6 +444,11 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
// fields they reference are visible, but must be resolved independently. |
if (element.isInitializingFormal) { |
registry.useElement(parameterNode, element); |
+ if (compiler.options.enableInitializingFormalAccess) { |
+ InitializingFormalElementX initializingFormalElementX = element; |
+ defineLocalVariable(parameterNode, initializingFormalElementX); |
+ addToScope(initializingFormalElementX); |
+ } |
} else { |
LocalParameterElementX parameterElement = element; |
defineLocalVariable(parameterNode, parameterElement); |
@@ -886,6 +891,8 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
} else { |
return new StaticAccess.parameter(target); |
} |
+ } else if (target.isInitializingFormal){ |
+ return new StaticAccess.finalParameter(target); |
} else if (target.isVariable) { |
if (target.isFinal || target.isConst) { |
return new StaticAccess.finalLocalVariable(target); |