Skip to content

Commit be708bb

Browse files
committed
fix assignment check of logical assignment
1 parent d2be890 commit be708bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19772,6 +19772,9 @@ namespace ts {
1977219772
case SyntaxKind.BinaryExpression:
1977319773
switch ((<BinaryExpression>node).operatorToken.kind) {
1977419774
case SyntaxKind.EqualsToken:
19775+
case SyntaxKind.BarBarEqualsToken:
19776+
case SyntaxKind.AmpersandAmpersandEqualsToken:
19777+
case SyntaxKind.QuestionQuestionEqualsToken:
1977519778
return getReferenceCandidate((<BinaryExpression>node).left);
1977619779
case SyntaxKind.CommaToken:
1977719780
return getReferenceCandidate((<BinaryExpression>node).right);
@@ -28590,7 +28593,7 @@ namespace ts {
2859028593
getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) :
2859128594
leftType;
2859228595
if (operator === SyntaxKind.AmpersandAmpersandEqualsToken) {
28593-
checkAssignmentOperator(resultType);
28596+
checkAssignmentOperator(rightType);
2859428597
}
2859528598
return resultType;
2859628599
}

0 commit comments

Comments
 (0)