diff --git a/ets2panda/checker/ets/utilityTypeHandlers.cpp b/ets2panda/checker/ets/utilityTypeHandlers.cpp index e893a1a9513ca7215bef08aa69d9c30cb8641f05..883de6f6ed02978dcbba4a2b155e552a2da9d841 100644 --- a/ets2panda/checker/ets/utilityTypeHandlers.cpp +++ b/ets2panda/checker/ets/utilityTypeHandlers.cpp @@ -121,7 +121,7 @@ Type *ETSChecker::CreatePartialType(Type *const typeToBePartial) { ES2PANDA_ASSERT(typeToBePartial->IsETSReferenceType()); - if (typeToBePartial->IsETSAnyType()) { + if (typeToBePartial->IsETSAnyType() || typeToBePartial->IsTypeError()) { return typeToBePartial; } diff --git a/ets2panda/test/ast/compiler/ets/unsupport_any.ets b/ets2panda/test/ast/compiler/ets/unsupport_any.ets new file mode 100644 index 0000000000000000000000000000000000000000..a15e30902a985d5228a105a53dab37519821cbdf --- /dev/null +++ b/ets2panda/test/ast/compiler/ets/unsupport_any.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024-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. + */ + +function assign>(sourtc: T, target: Partial) { + +} + +/* @@? 16:42 Error TypeError: Cannot find type 'any'. */