-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flow analysis: ensure that
restrict
method doesn't try to promote w…
…rite-captured variables. Fixes #42066 Change-Id: Ieab80c004b3d331abb81916c3e158416bcd3ce86 Bug: #42066 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153480 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
- Loading branch information
1 parent
653e444
commit 36e89f8
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/bug42066.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
f() { | ||
num par2; | ||
par2 = 0; | ||
if (par2 is! int) return; | ||
try {} catch (exception) { | ||
throw 'x'; | ||
() { | ||
par2 = 1; | ||
}; | ||
} finally {} | ||
} |