Skip to content

Commit fed7ffa

Browse files
authored
fix: use common type for numeric check on binary subtraction (#3003)
1 parent 9ffcf25 commit fed7ffa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4150,7 +4150,7 @@ export class Compiler extends DiagnosticEmitter {
41504150
rightExpr = this.compileExpression(right, leftType);
41514151
rightType = this.currentType;
41524152
commonType = Type.commonType(leftType, rightType, contextualType);
4153-
if (!commonType || !leftType.isNumericValue) {
4153+
if (!commonType || !commonType.isNumericValue) {
41544154
this.error(
41554155
DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
41564156
expression.range, "-", leftType.toString(), rightType.toString()

0 commit comments

Comments
 (0)