diff --git a/ets2panda/checker/ets/utilityTypeHandlers.cpp b/ets2panda/checker/ets/utilityTypeHandlers.cpp index 93f6b5eccc737df9ed001d1f9d02975aa04d2d76..584958e790a6571255ff9e270923b38a9c2631b3 100644 --- a/ets2panda/checker/ets/utilityTypeHandlers.cpp +++ b/ets2panda/checker/ets/utilityTypeHandlers.cpp @@ -325,6 +325,7 @@ ir::ClassProperty *ETSChecker::CreateNullishProperty(ir::ClassProperty *const pr prop->SetValue(nullptr); // SUPPRESS_CSA_NEXTLINE(alpha.core.AllocatorETSCheckerHint) auto *const propClone = prop->Clone(ProgramAllocator(), newClassDefinition)->AsClassProperty(); + propClone->CleanCheckInformation(); // Revert original property value prop->SetValue(propSavedValue); diff --git a/ets2panda/test/runtime/ets/AnnotationOfExportClassProperty.ets b/ets2panda/test/runtime/ets/AnnotationOfExportClassProperty.ets new file mode 100644 index 0000000000000000000000000000000000000000..89963cc4476ff6d8e24979b986d87a742d4db6e8 --- /dev/null +++ b/ets2panda/test/runtime/ets/AnnotationOfExportClassProperty.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@interface SomeAnnotation { + field1: int = 1 +} + +@SomeAnnotation() +export class MyClass { + @SomeAnnotation() + field: int = 1 +}