fix assignment check of logical assignment
This commit is contained in:
parent
d2be8900dc
commit
be708bbb0a
1 changed files with 4 additions and 1 deletions
|
@ -19772,6 +19772,9 @@ namespace ts {
|
||||||
case SyntaxKind.BinaryExpression:
|
case SyntaxKind.BinaryExpression:
|
||||||
switch ((<BinaryExpression>node).operatorToken.kind) {
|
switch ((<BinaryExpression>node).operatorToken.kind) {
|
||||||
case SyntaxKind.EqualsToken:
|
case SyntaxKind.EqualsToken:
|
||||||
|
case SyntaxKind.BarBarEqualsToken:
|
||||||
|
case SyntaxKind.AmpersandAmpersandEqualsToken:
|
||||||
|
case SyntaxKind.QuestionQuestionEqualsToken:
|
||||||
return getReferenceCandidate((<BinaryExpression>node).left);
|
return getReferenceCandidate((<BinaryExpression>node).left);
|
||||||
case SyntaxKind.CommaToken:
|
case SyntaxKind.CommaToken:
|
||||||
return getReferenceCandidate((<BinaryExpression>node).right);
|
return getReferenceCandidate((<BinaryExpression>node).right);
|
||||||
|
@ -28590,7 +28593,7 @@ namespace ts {
|
||||||
getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) :
|
getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) :
|
||||||
leftType;
|
leftType;
|
||||||
if (operator === SyntaxKind.AmpersandAmpersandEqualsToken) {
|
if (operator === SyntaxKind.AmpersandAmpersandEqualsToken) {
|
||||||
checkAssignmentOperator(resultType);
|
checkAssignmentOperator(rightType);
|
||||||
}
|
}
|
||||||
return resultType;
|
return resultType;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue