Skip to content

Commit 6364c59

Browse files
stereotype441commit-bot@chromium.org
authored andcommitted
Migration: substitute properly when handling compound assignments.
Change-Id: Ib8f26959688df3b2fc6aa2db66331ef0ec357794 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120500 Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
1 parent 0eff6b3 commit 6364c59

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/nnbd_migration/lib/src/edge_builder.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,8 +1643,9 @@ class EdgeBuilder extends GeneralizingAstVisitor<DecoratedType>
16431643
destination: _notNullType,
16441644
hard: _postDominatedLocals
16451645
.isReferenceInScope(destinationExpression));
1646-
DecoratedType compoundOperatorType =
1647-
getOrComputeElementType(compoundOperatorMethod);
1646+
DecoratedType compoundOperatorType = getOrComputeElementType(
1647+
compoundOperatorMethod,
1648+
targetType: destinationType);
16481649
assert(compoundOperatorType.positionalParameters.length > 0);
16491650
_checkAssignment(edgeOrigin,
16501651
source: sourceType,

pkg/nnbd_migration/test/edge_builder_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ C f(C y, C z) => (y += z);
641641
assertNullCheck(checkExpression('(y += z)'), fReturnEdge);
642642
}
643643

644-
@failingTest
645644
test_assignmentExpression_compound_withSubstitution() async {
646645
// Failing due to a side-cast from incorrectly instantiating the operator.
647646
var code = '''

0 commit comments

Comments
 (0)