Skip to content

Commit a5683df

Browse files
stereotype441commit-bot@chromium.org
authored andcommitted
Migration: add a repro for an issue with field formal parameters.
See #38453. Change-Id: I7ecf1c020437b7e332e7646cc40e947f38a081bf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117687 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent dce98a2 commit a5683df

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pkg/nnbd_migration/test/api_test.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,6 +3040,27 @@ void h(bool b, int? i) {
30403040
main() {
30413041
h(false, null);
30423042
}
3043+
''';
3044+
await _checkSingleFileChanges(content, expected);
3045+
}
3046+
3047+
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/38453')
3048+
test_unconditional_use_of_field_formal_param_does_not_create_hard_edge() async {
3049+
var content = '''
3050+
class C {
3051+
int i;
3052+
int j;
3053+
C.one(this.i) : j = i + 1;
3054+
C.two() : i = null, j = 0;
3055+
}
3056+
''';
3057+
var expected = '''
3058+
class C {
3059+
int? i;
3060+
int j;
3061+
C.one(this.i) : j = i! + 1;
3062+
C.two() : i = null, j = 0;
3063+
}
30433064
''';
30443065
await _checkSingleFileChanges(content, expected);
30453066
}

0 commit comments

Comments
 (0)