diff --git a/ets2panda/checker/ets/typeCheckingHelpers.cpp b/ets2panda/checker/ets/typeCheckingHelpers.cpp index 5ea56002c7a392282b6056e307d387f7af289b5e..f4048ebd6fee8ee42d1095630f6b38831b14d672 100644 --- a/ets2panda/checker/ets/typeCheckingHelpers.cpp +++ b/ets2panda/checker/ets/typeCheckingHelpers.cpp @@ -709,11 +709,8 @@ Type *ETSChecker::GuaranteedTypeForUncheckedPropertyAccess(varbinder::Variable * case ir::AstNodeType::METHOD_DEFINITION: case ir::AstNodeType::CLASS_DEFINITION: return GetTypeOfVariable(prop); - case ir::AstNodeType::OVERLOAD_DECLARATION: - case ir::AstNodeType::TS_ENUM_DECLARATION: - return nullptr; default: - ES2PANDA_UNREACHABLE(); + return nullptr; } } diff --git a/ets2panda/test/runtime/ets/fuzz/class_body_interface.ets b/ets2panda/test/runtime/ets/fuzz/class_body_interface.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c8c0895e44f6cf0697c129589f10f581a71de28 --- /dev/null +++ b/ets2panda/test/runtime/ets/fuzz/class_body_interface.ets @@ -0,0 +1,27 @@ +/* + * 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. + */ +/*--- + tags: [compile-only, negative] +---*/ + +class A { + interface foo {} +} + +class B { + A.foo f1 = new A.foo() { + A.foo bar() {} + } +} diff --git a/ets2panda/test/test-lists/declgenets2ts/ets-runtime/declgen-ets2ts-runtime-ignored.txt b/ets2panda/test/test-lists/declgenets2ts/ets-runtime/declgen-ets2ts-runtime-ignored.txt index 7668597d9d05f70c40f5590a7c593154f315a223..dd3f9cb37811963875178a869ec5ada064282169 100644 --- a/ets2panda/test/test-lists/declgenets2ts/ets-runtime/declgen-ets2ts-runtime-ignored.txt +++ b/ets2panda/test/test-lists/declgenets2ts/ets-runtime/declgen-ets2ts-runtime-ignored.txt @@ -32,3 +32,4 @@ Multiline_string_escape_char.ets run_ok_without_semicolon.ets async_lambda_return_type_test.ets fuzz/repeated_del.ets +fuzz/class_body_interface.ets diff --git a/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt b/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt index c3722928d89371fce28556ab431fc78b63117fe6..a7c61d98b5e0d63f34bc7ea57656c420ae827273 100644 --- a/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt +++ b/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt @@ -57,6 +57,7 @@ runtime/ets/fuzz/too_many_new_expr.ets runtime/ets/fuzz/too_many_token.ets runtime/ets/fuzz/repeated_del.ets runtime/ets/fuzz/too_many_expression.ets +runtime/ets/fuzz/class_body_interface.ets ast/compiler/ets/DeclareIndexerTest.ets ast/parser/ets/import_tests/import_class_with_static_field/import_class_with_static_field.ets