diff --git a/ets2panda/checker/ets/utilityTypeHandlers.cpp b/ets2panda/checker/ets/utilityTypeHandlers.cpp index 0224e9882e96e3def1e6afc428167f00011afc6f..107f18115fe12165bca7d093a561aac47379e2d1 100644 --- a/ets2panda/checker/ets/utilityTypeHandlers.cpp +++ b/ets2panda/checker/ets/utilityTypeHandlers.cpp @@ -886,6 +886,9 @@ Type *ETSChecker::CreatePartialTypeClassDef(ir::ClassDefinition *const partialCl LogError(diagnostic::CYCLIC_CLASS_SUPER_TYPE, {}, classDef->Start()); return partialType; } + if (partialSuper->IsTypeError()) { + return partialType; + } partialType->SetSuperType(partialSuper->AsETSObjectType()); } diff --git a/ets2panda/test/ast/compiler/ets/fuzzingtest6.ets b/ets2panda/test/ast/compiler/ets/fuzzingtest6.ets new file mode 100644 index 0000000000000000000000000000000000000000..79c7af6977e643e5033a498f04f1560735c5f29a --- /dev/null +++ b/ets2panda/test/ast/compiler/ets/fuzzingtest6.ets @@ -0,0 +1,25 @@ +/* + * 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 inter { } + +class B extends A implements inter { +} + +function foo1(b: Partial>) { +} + +/* @@? 18:20 Error TypeError: Cannot find type 'A'. */ +/* @@? 18:20 Error TypeError: The super type of 'B' class is not extensible. */