diff --git a/ets2panda/checker/ets/function.cpp b/ets2panda/checker/ets/function.cpp index a10f692e51433f45b67474f19661dbb926d30f23..2096688b6ed51f2c0c0f5d3d95e71f9c581fcb05 100644 --- a/ets2panda/checker/ets/function.cpp +++ b/ets2panda/checker/ets/function.cpp @@ -872,9 +872,13 @@ Signature *ETSChecker::ValidateSignatures(ArenaVector &signatures, if (!compatibleSignatures.empty()) { // SUPPRESS_CSA_NEXTLINE(alpha.core.AllocatorETSCheckerHint) auto *sig = GetMostSpecificSignature(compatibleSignatures, arguments, pos, resolveFlags); - // May need to re-check the arguments now that we know the particular signature to call. - ValidateSignature({sig, nullptr, TypeRelationFlag::WIDENING | TypeRelationFlag::NO_SUBSTITUTION_NEEDED}, - arguments, pos, FindTypeInferenceArguments(arguments), true); + // NOTE (DZ): skip Promise constructor check - temporary solution, need to be removed after fixing OHOS code! + if (sig == nullptr || !sig->HasFunction() || !sig->Function()->IsConstructor() || + !sig->Owner()->Name().Is("Promise")) { + // May need to re-check the arguments now that we know the particular signature to call. + ValidateSignature({sig, nullptr, TypeRelationFlag::WIDENING | TypeRelationFlag::NO_SUBSTITUTION_NEEDED}, + arguments, pos, FindTypeInferenceArguments(arguments), true); + } return sig; } diff --git a/ets2panda/checker/ets/typeCheckingHelpers.cpp b/ets2panda/checker/ets/typeCheckingHelpers.cpp index 6598de069087d0e13410fb2fe19bfb81d33cb9e1..a8889c7de8c92f182993d36ba0f232ce726c7ae2 100644 --- a/ets2panda/checker/ets/typeCheckingHelpers.cpp +++ b/ets2panda/checker/ets/typeCheckingHelpers.cpp @@ -1421,8 +1421,7 @@ bool ETSChecker::CheckLambdaTypeAnnotation(ir::ETSParameterExpression *param, return true; } // SUPPRESS_CSA_NEXTLINE(alpha.core.AllocatorETSCheckerHint) - return CheckLambdaInfer(typeAnnotation, arrowFuncExpr, nonNullishParam) && - (checkInvocable(flags) || CheckLambdaAssignable(param, arrowFuncExpr->Function())); + return CheckLambdaInfer(typeAnnotation, arrowFuncExpr, nonNullishParam) && checkInvocable(flags); } // Preserve actual lambda types