From a5f3ccb485bcd3586c7430212e8fb3e9f8fbc76f Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Sat, 28 Mar 2026 16:07:58 +0800 Subject: [PATCH 1/2] fix: use common type for numeric check on binary subtraction Non-compound `-` computes `commonType` for both operands; the validity check should use `commonType.isNumericValue`, not `leftType.isNumericValue`. --- src/compiler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.ts b/src/compiler.ts index 36f09ab8aa..4b246478eb 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -4150,7 +4150,7 @@ export class Compiler extends DiagnosticEmitter { rightExpr = this.compileExpression(right, leftType); rightType = this.currentType; commonType = Type.commonType(leftType, rightType, contextualType); - if (!commonType || !leftType.isNumericValue) { + if (!commonType || !commonType.isNumericValue) { this.error( DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2, expression.range, "-", leftType.toString(), rightType.toString() From 34775855b688f6d7c5954c9f124ba461b16f52da Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Sat, 28 Mar 2026 16:07:59 +0800 Subject: [PATCH 2/2] chore: add Weixie Cui to NOTICE --- NOTICE | 1 + 1 file changed, 1 insertion(+) diff --git a/NOTICE b/NOTICE index 14d821345c..148bc0ca87 100644 --- a/NOTICE +++ b/NOTICE @@ -62,6 +62,7 @@ under the licensing terms detailed in LICENSE: * Kam Chehresa * Mopsgamer <79159094+Mopsgamer@users.noreply.github.com> * EDM115 +* Weixie Cui Portions of this software are derived from third-party works licensed under the following terms: