diff --git a/ets2panda/checker/ets/typeCheckingHelpers.cpp b/ets2panda/checker/ets/typeCheckingHelpers.cpp index dd0a84f46ecb2e89a75531ed8d1a04f43d4345c3..5233e18ba11fac2ee25123936523254102026116 100644 --- a/ets2panda/checker/ets/typeCheckingHelpers.cpp +++ b/ets2panda/checker/ets/typeCheckingHelpers.cpp @@ -710,11 +710,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 4444cd873b3219913e341f394f3a026e272d21e9..61fb015d81cbaf7adc057474ceba26b74d3af6ce 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 @@ -30,3 +30,4 @@ typeAlias_2.ets Multiline_string.ets Multiline_string_escape_char.ets async_lambda_return_type_test.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 85df783af7634a9ae8bc2191dc6f5e27f55d96f0..d83411312362773be86681c1023b31a55b3245f6 100644 --- a/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt +++ b/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt @@ -54,6 +54,7 @@ runtime/ets/fuzz/too_many_left_brace.ets runtime/ets/fuzz/too_many_left_square_brackets.ets runtime/ets/fuzz/too_many_new_expr.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