diff --git a/ets2panda/checker/ETSAnalyzer.cpp b/ets2panda/checker/ETSAnalyzer.cpp index 0ecc1e27aa174064879ad4f3cbe3e6d45ab630d8..195d8b228db9a4e38672e560c7f49ea0ea6fa104 100644 --- a/ets2panda/checker/ETSAnalyzer.cpp +++ b/ets2panda/checker/ETSAnalyzer.cpp @@ -1568,6 +1568,7 @@ checker::Type *ETSAnalyzer::Check(ir::CallExpression *expr) const checker::TypeStackElement tse(checker, expr, {{diagnostic::CYCLIC_CALLEE, {}}}, expr->Start()); if (tse.HasTypeError()) { + expr->SetTsType(checker->GlobalTypeError()); return checker->GlobalTypeError(); } diff --git a/ets2panda/test/ast/compiler/ets/fuzz_invalid_property.ets b/ets2panda/test/ast/compiler/ets/fuzz_invalid_property.ets new file mode 100644 index 0000000000000000000000000000000000000000..93b7801f20529d79e1daeee661be632895a3ab8b --- /dev/null +++ b/ets2panda/test/ast/compiler/ets/fuzz_invalid_property.ets @@ -0,0 +1,21 @@ +/* + * 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. + */ + +class D{ + strB = (new StringBuilder).append('{ ').append(strB.toString()).append(' }') +} + +/* @@? 17:12 Error TypeError: Circular call function */ +/* @@? 17:52 Error TypeError: Property 'strB' must be accessed through 'this' */