diff --git a/ets2panda/linter/homecheck/src/checker/migration/NumericSemanticCheck.ts b/ets2panda/linter/homecheck/src/checker/migration/NumericSemanticCheck.ts index 359b025482a1c6bec08b400631a038e9d7a773e0..bff6fd3a640d69939d4166180405b7fb83861d12 100644 --- a/ets2panda/linter/homecheck/src/checker/migration/NumericSemanticCheck.ts +++ b/ets2panda/linter/homecheck/src/checker/migration/NumericSemanticCheck.ts @@ -1014,9 +1014,11 @@ export class NumericSemanticCheck implements BaseChecker { const ets1Class = ets1SDK.getDeclaringArkClass(); const ets1Namespace = ets1Class.getDeclaringArkNamespace(); if (ets1Namespace === undefined) { - return ets2File.getClassWithName(ets1Class.getName())?.getMethodWithName(ets1SDK.getName()) ?? null; + const ets2Class = ets2File.getClassWithName(ets1Class.getName()); + return ets2Class?.getMethodWithName(ets1SDK.getName()) ?? ets2Class?.getStaticMethodWithName(ets1SDK.getName()) ?? null; } - return ets2File.getNamespaceWithName(ets1Namespace.getName())?.getClassWithName(ets1Class.getName())?.getMethodWithName(ets1SDK.getName()) ?? null; + const ets2Class = ets2File.getNamespaceWithName(ets1Namespace.getName())?.getClassWithName(ets1Class.getName()); + return ets2Class?.getMethodWithName(ets1SDK.getName()) ?? ets2Class?.getStaticMethodWithName(ets1SDK.getName()) ?? null; } // 判断类型是否为int,当前ArkAnalyzer对于int的表示应该是name为int的AliasType或UnclearReferenceType