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

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

Issue 2025853002: Introduces "--initializing-formal-access". (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Eliminated unnecessary changes, thus avoiding 35 failing tests. Created 4 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/options.dart ('k') | pkg/compiler/lib/src/typechecker.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 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);
« no previous file with comments | « pkg/compiler/lib/src/options.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698