diff --git a/ets2panda/checker/ets/object.cpp b/ets2panda/checker/ets/object.cpp index be5c85e5a3b692a86242cd86bc9184fa201f921f..bb9dda7240a3fd7ce29d88e4f1c6ae513a1f7d9d 100644 --- a/ets2panda/checker/ets/object.cpp +++ b/ets2panda/checker/ets/object.cpp @@ -1524,7 +1524,7 @@ bool ETSChecker::ValidateArrayIndex(ir::Expression *const expr, bool relaxed) return true; } - ASSERT(expr->IsNumberLiteral()); + ES2PANDA_ASSERT(expr->IsNumberLiteral()); double value = expr->AsNumberLiteral()->Number().GetDouble(); double intPart; diff --git a/ets2panda/checker/types/ets/byteType.cpp b/ets2panda/checker/types/ets/byteType.cpp index 785bb846ff513c954d8cd0b12a427e77bbb1c90e..e69f7aff80e99cd986e89b4a4b5dc09b98f17023 100644 --- a/ets2panda/checker/types/ets/byteType.cpp +++ b/ets2panda/checker/types/ets/byteType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ets2panda/checker/types/ets/charType.cpp b/ets2panda/checker/types/ets/charType.cpp index 833cb3fc0bd2befcbd19315bf1dcecc5af904a68..c127dc4831c734951a2c71101061c6c2214f17bd 100644 --- a/ets2panda/checker/types/ets/charType.cpp +++ b/ets2panda/checker/types/ets/charType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ets2panda/checker/types/ets/doubleType.cpp b/ets2panda/checker/types/ets/doubleType.cpp index 1f28076d58c673f84f7a80c6bf06e13c4dd77038..ad58d7bc8c9a5470fb94e12a8b57660b0dd10813 100644 --- a/ets2panda/checker/types/ets/doubleType.cpp +++ b/ets2panda/checker/types/ets/doubleType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ets2panda/checker/types/ets/floatType.cpp b/ets2panda/checker/types/ets/floatType.cpp index 27e1ce463b0ed5c0ae3531aa85bff67273dc4f8f..958f338480b0afa1b7787edfc1f443222202edb5 100644 --- a/ets2panda/checker/types/ets/floatType.cpp +++ b/ets2panda/checker/types/ets/floatType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ets2panda/checker/types/ets/longType.cpp b/ets2panda/checker/types/ets/longType.cpp index 248c36709728cc20214fe62f64d2fb9db06fd4c0..7b8c5b34fae0af6e8144ecc4412a82528e8c93ba 100644 --- a/ets2panda/checker/types/ets/longType.cpp +++ b/ets2panda/checker/types/ets/longType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ets2panda/checker/types/ets/shortType.cpp b/ets2panda/checker/types/ets/shortType.cpp index 7736e66bb89a7701a5e2e2b8904ccfd9d6cff929..c7f79a229ea6be5b256578cf30154725121f5e93 100644 --- a/ets2panda/checker/types/ets/shortType.cpp +++ b/ets2panda/checker/types/ets/shortType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ets2panda/test/unit/lsp/get_type_of_symbol_at_location_test.cpp b/ets2panda/test/unit/lsp/get_type_of_symbol_at_location_test.cpp index 69839da3168a6edaa41fe47c5442392c01e3fb9c..07d819f8b7a376a965661cdb7c1d5016cbd2bc4e 100644 --- a/ets2panda/test/unit/lsp/get_type_of_symbol_at_location_test.cpp +++ b/ets2panda/test/unit/lsp/get_type_of_symbol_at_location_test.cpp @@ -26,7 +26,7 @@ namespace { using ark::es2panda::lsp::Initializer; -static auto g_fileSource = +auto g_fileSource = "let a: number;\nlet b: byte;\nlet c: short;\nlet d: int;\nlet e: long;\nlet f: " "float;\nlet g: double;\nlet h: char;\nlet i: boolean;"; diff --git a/ets2panda/test/unit/public/ast_builder_test.cpp b/ets2panda/test/unit/public/ast_builder_test.cpp index 7bc7a7df898108aec4f2427bd77f2415a01ddb3a..559f1ed6ff202fade24ab7cb9556ad7c64dd63cc 100644 --- a/ets2panda/test/unit/public/ast_builder_test.cpp +++ b/ets2panda/test/unit/public/ast_builder_test.cpp @@ -99,6 +99,7 @@ using ark::es2panda::ir::VariableDeclarationBuilder; using ark::es2panda::ir::VariableDeclaratorBuilder; using ark::es2panda::ir::WhileStatementBuilder; +// NOLINTBEGIN(readability-magic-numbers) namespace { TEST_F(ASTVerifierTest, arrowFunctionExpressionBuild) { @@ -429,3 +430,4 @@ TEST_F(ASTVerifierTest, multipleImportTest) ASSERT_TRUE(classDecl->IsClassDeclaration()); } } // anonymous namespace +// NOLINTEND(readability-magic-numbers) diff --git a/ets2panda/test/unit/union_normalization_test_1.cpp b/ets2panda/test/unit/union_normalization_test_1.cpp index 733ebbbc61ea07b37ddfa7532d298335e7471ed6..d4cbe2fb7d3e38397d63de770249ceec054843ad 100644 --- a/ets2panda/test/unit/union_normalization_test_1.cpp +++ b/ets2panda/test/unit/union_normalization_test_1.cpp @@ -47,7 +47,7 @@ TEST_F(UnionNormalizationTest, UnionWithObject) ASSERT(checker); ArenaVector unionConstituents(checker->Allocator()->Adapter()); - unionConstituents.emplace_back(checker->GlobalIntType()); + unionConstituents.emplace_back(checker->GlobalIntBuiltinType()); unionConstituents.emplace_back(checker->GetGlobalTypesHolder()->GlobalETSObjectType()); unionConstituents.emplace_back(checker->GetGlobalTypesHolder()->GlobalETSStringBuiltinType()); @@ -73,10 +73,10 @@ TEST_F(UnionNormalizationTest, UnionWithIdenticalTypes1) ASSERT(checker); ArenaVector unionConstituents(checker->Allocator()->Adapter()); - unionConstituents.emplace_back(checker->GlobalDoubleType()); + unionConstituents.emplace_back(checker->GlobalDoubleBuiltinType()); unionConstituents.emplace_back(baseType); unionConstituents.emplace_back(checker->GlobalBuiltinETSStringType()); - unionConstituents.emplace_back(checker->GlobalDoubleType()); + unionConstituents.emplace_back(checker->GlobalDoubleBuiltinType()); // Create union type, which will be normalized inside creation function auto *const normalizedType = checker->CreateETSUnionType(std::move(unionConstituents)); diff --git a/ets2panda/test/unit/union_normalization_test_2.cpp b/ets2panda/test/unit/union_normalization_test_2.cpp index 44f8002c32079b83eeee22f8bfaabf65f74c4445..59715ca07ed513bca002240473d024897bbf922e 100644 --- a/ets2panda/test/unit/union_normalization_test_2.cpp +++ b/ets2panda/test/unit/union_normalization_test_2.cpp @@ -203,7 +203,7 @@ TEST_F(UnionNormalizationTest, UnionStringLiterals1) // Test normalization: number | "abc" | string | "xy" ==> number | string ArenaVector unionConstituents3(checker->Allocator()->Adapter()); - unionConstituents3.emplace_back(checker->GlobalDoubleType()); + unionConstituents3.emplace_back(checker->GlobalDoubleBuiltinType()); unionConstituents3.emplace_back(checker->CreateETSStringLiteralType("abc")); unionConstituents3.emplace_back(checker->GlobalBuiltinETSStringType()); unionConstituents3.emplace_back(checker->CreateETSStringLiteralType("xy")); @@ -279,7 +279,7 @@ TEST_F(UnionNormalizationTest, UnionStringLiterals2) unionConstituents3.emplace_back(checker->CreateETSStringLiteralType("bc2")); unionConstituents3.emplace_back(checker->CreateETSStringLiteralType("cd3")); unionConstituents3.emplace_back(checker->GlobalBuiltinETSStringType()); - unionConstituents3.emplace_back(checker->GlobalIntType()); + unionConstituents3.emplace_back(checker->GlobalIntBuiltinType()); // Create union type, which will be normalized inside creation function auto *const normalizedType3 = checker->CreateETSUnionType(std::move(unionConstituents3));