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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 2039833002: New tests for initializing formal access. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Review response, just changing expected exception type Created 4 years, 6 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 | « no previous file | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 18eeb525aae5d4bfee63c7ff83332f4c761430db..28cc94a842012e74e85d78b04be75b6c7f75f1d0 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -3859,7 +3859,7 @@ class TryBoxedVariables extends ast.Visitor {
if (Elements.isLocal(element)) {
LocalElement local = element;
if (insideInitializer &&
- local.isParameter &&
+ (local.isParameter || local.isInitializingFormal) &&
local.enclosingElement == currentFunction) {
assert(local.enclosingElement.isConstructor);
// Initializers in an initializer-list can communicate via parameters.
@@ -3871,7 +3871,9 @@ class TryBoxedVariables extends ast.Visitor {
// outlive the activation of the function).
markAsCaptured(local);
} else if (inTryStatement) {
- assert(local.isParameter || local.isVariable);
+ assert(local.isParameter ||
+ local.isVariable ||
+ local.isInitializingFormal);
// Search for the position of the try block containing the variable
// declaration, or -1 if it is declared outside the outermost try.
int i = tryNestingStack.length - 1;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698