From 542661687909e73799da584bc90b4047fff39b91 Mon Sep 17 00:00:00 2001 From: Daniel Kofanov Date: Fri, 27 Jun 2025 03:48:04 +0800 Subject: [PATCH] [ArkTS] Enable no-primitives invariant Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICI4WX?from=project-issue Change-Id: I46e78308ccb5be4b356a4098d68783395da616f4 Signed-off-by: Daniel Kofanov --- ets2panda/ast_verifier/ASTVerifier.h | 3 ++- ets2panda/ast_verifier/invariants/nodeHasType.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ets2panda/ast_verifier/ASTVerifier.h b/ets2panda/ast_verifier/ASTVerifier.h index 9aaa1aecc3..1bd190ef76 100644 --- a/ets2panda/ast_verifier/ASTVerifier.h +++ b/ets2panda/ast_verifier/ASTVerifier.h @@ -129,7 +129,8 @@ public: i <= VerifierInvariants::AFTER_CHECKER_PHASE_LAST; i++) { allowed_[i] = true; } - // NOTE(dkofanov): This should be called after "NumberLowering" phase: + } + if (occurredPhaseName == "Unbox") { Get()->SetNumberLoweringOccured(); } if (occurredPhaseName == "UnionLowering") { diff --git a/ets2panda/ast_verifier/invariants/nodeHasType.h b/ets2panda/ast_verifier/invariants/nodeHasType.h index 81769166cf..edfee888c3 100644 --- a/ets2panda/ast_verifier/invariants/nodeHasType.h +++ b/ets2panda/ast_verifier/invariants/nodeHasType.h @@ -49,7 +49,8 @@ public: if (type == nullptr) { return {CheckDecision::CORRECT, CheckAction::CONTINUE}; } - if (!numberLoweringOccurred_ && type->IsETSPrimitiveType()) { + // NOTE(dkofanov): Broken extension functions. + if (!numberLoweringOccurred_ && !type->IsETSExtensionFuncHelperType() && type->IsETSPrimitiveType()) { AddCheckMessage("PRIMITIVE_BEFORE_LOWERING", *ast); return {CheckDecision::INCORRECT, CheckAction::CONTINUE}; } -- Gitee