From c0ceaf27dc0150ff21e1663723e95e30397bd475 Mon Sep 17 00:00:00 2001 From: ZhongNing Date: Mon, 7 Jul 2025 17:11:14 +0800 Subject: [PATCH] fix issue for arkts-builtin-cotr Issue:https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICKE79 Test scenarios: new tests added to the linter Signed-off-by: ZhongNing --- ets2panda/linter/src/lib/TypeScriptLinter.ts | 3 +++ ets2panda/linter/test/builtin/builtin_callsignature.ets | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index ca04dbcfcd..835491bd40 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -4352,6 +4352,9 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { if (!this.options.arkts2) { return; } + if (ts.isCallExpression(tsCallExpr) && tsCallExpr.expression.kind === ts.SyntaxKind.SuperKeyword) { + return; + } const node = ts.isCallExpression(tsCallExpr) ? tsCallExpr.expression : tsCallExpr.typeName; const constructorType = this.tsTypeChecker.getTypeAtLocation(node); const callSignatures = constructorType.getCallSignatures(); diff --git a/ets2panda/linter/test/builtin/builtin_callsignature.ets b/ets2panda/linter/test/builtin/builtin_callsignature.ets index ccb7f4de95..c728c8dc6c 100644 --- a/ets2panda/linter/test/builtin/builtin_callsignature.ets +++ b/ets2panda/linter/test/builtin/builtin_callsignature.ets @@ -34,4 +34,10 @@ function anotherName(ctorName0: BigIntConstructor) { // ERROR type BigIntConstructor1 = BigIntConstructor; // ERROR let ctorName2:BigIntConstructor1 = ctorName1 // ERROR const rs2 = ctorName2(1); // ERROR +} + +class A extends Error { + constructor(str: string) { + super(str); + } } \ No newline at end of file -- Gitee