Skip to content

Commit dce3d05

Browse files
stereotype441commit-bot@chromium.org
authored andcommitted
Migration: Fix three broken FixBuilder unit tests.
These tests were all broken due to incorrect nullabilities in a generic class method. The brokenness was masked by issue #38900, which was fixed in 1b044ee. Change-Id: Ib77c437ae147afd10cc46e0685db25ce844bd99b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121960 Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
1 parent 8eb28a4 commit dce3d05

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

pkg/nnbd_migration/test/fix_builder_test.dart

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,11 @@ _f(_C<int, String> c) => c['foo'] = 1;
365365
visitAssignmentTarget(findNode.index('c['), null, 'int');
366366
}
367367

368-
@FailingTest(reason: r'''
369-
This test was broken because of considering type parameter type nullabilities.
370-
''')
371368
test_assignmentTarget_indexExpression_substituted_check_rhs() async {
372369
await analyze('''
373370
class _C<T, U> {
374371
T operator[](U u) => throw 'foo';
375-
void operator[]=(U/*?*/ u, T t) {}
372+
void operator[]=(U/*!*/ u, T t) {}
376373
}
377374
_f(_C<int, String/*!*/> c, String/*?*/ s) => c[s] = 1;
378375
''');
@@ -824,16 +821,10 @@ _f(_C<int, String> c) => c + 'foo';
824821
visitSubexpression(findNode.binary('c +'), 'int');
825822
}
826823

827-
@FailingTest(reason: r'''
828-
The code is resolved without NNBD, so the type of `T operator+(U u)` is
829-
`T* Function(U*)`. When we replace `T` with `int!`, and `U` with `String!` we
830-
get `int* Function(String*)`. Previously we substituted without considering
831-
type parameter type nullabilities.
832-
''')
833824
test_binaryExpression_userDefinable_substituted_check_rhs() async {
834825
await analyze('''
835826
class _C<T, U> {
836-
T operator+(U u) => throw 'foo';
827+
T operator+(U/*!*/ u) => throw 'foo';
837828
}
838829
_f(_C<int, String/*!*/> c, String/*?*/ s) => c + s;
839830
''');
@@ -1028,13 +1019,10 @@ _f(_C<int, String> c) => c['foo'];
10281019
visitSubexpression(findNode.index('c['), 'int');
10291020
}
10301021

1031-
@FailingTest(reason: r'''
1032-
This test was broken because of considering type parameter type nullabilities.
1033-
''')
10341022
test_indexExpression_substituted_check_rhs() async {
10351023
await analyze('''
10361024
class _C<T, U> {
1037-
T operator[](U u) => throw 'foo';
1025+
T operator[](U/*!*/ u) => throw 'foo';
10381026
}
10391027
_f(_C<int, String/*!*/> c, String/*?*/ s) => c[s];
10401028
''');

0 commit comments

Comments
 (0)