From c3a93e1fb0787ffdd9c98c6584843831c0d6ef8e Mon Sep 17 00:00:00 2001 From: tengtengh Date: Tue, 29 Jul 2025 16:12:26 +0800 Subject: [PATCH] cherry-pick to 0728: Fix the bug of Required Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICSC6D Signed-off-by: tengtengh --- ets2panda/checker/ets/utilityTypeHandlers.cpp | 14 ++++++++ .../compiler/ets/Partial_utility_type_0.ets | 32 ++++++++++++++++++ .../compiler/ets/Required_utility_type_0.ets | 33 +++++++++++++++++++ .../ets/partialTypeParameterParamInfer.ets | 18 ++++++++++ ...rtialType_check_in_RemoveUndefinedType.ets | 1 + .../ast/compiler/ets/requiredType_10_neg.ets | 2 +- .../ets/union_type_of_partial_type.ets | 1 + .../ets/unresolve_class_with_type_infer.ets | 3 ++ ...ility_type_can_not_found_etsobjecttype.ets | 3 +- .../test/ast/parser/ets/partialType_4.ets | 7 +++- .../ast/parser/ets/partial_type_param1.ets | 4 ++- .../ast/parser/ets/partial_type_param2.ets | 4 ++- .../ast/parser/ets/type_from_utility_type.ets | 3 ++ ets2panda/test/benchmarks/bench_1.ets | 33 +++++++++++-------- .../compiler/ets/requiredType_11-expected.txt | 1 + .../compiler/ets/requiredType_9-expected.txt | 2 ++ .../runtime/ets/{ => fuzz}/too_many_async.ets | 0 .../runtime/ets/{ => fuzz}/too_many_await.ets | 0 .../ets/{ => fuzz}/too_many_call_expr.ets | 0 .../ets/{ => fuzz}/too_many_left_brace.ets | 0 .../too_many_left_square_brackets.ets | 0 .../ets/{ => fuzz}/too_many_new_expr.ets | 0 .../test/runtime/ets/partialTypeRuntime_2.ets | 10 +++--- .../declgen-ets2ts-runtime-ignored.txt | 2 +- .../srcdumper/srcdumper-ets-ignored.txt | 11 +++---- ets2panda/util/diagnostic/semantic.yaml | 4 +++ 26 files changed, 157 insertions(+), 31 deletions(-) create mode 100644 ets2panda/test/ast/compiler/ets/Partial_utility_type_0.ets create mode 100644 ets2panda/test/ast/compiler/ets/Required_utility_type_0.ets create mode 100644 ets2panda/test/ast/compiler/ets/partialTypeParameterParamInfer.ets rename ets2panda/test/runtime/ets/{ => fuzz}/too_many_async.ets (100%) rename ets2panda/test/runtime/ets/{ => fuzz}/too_many_await.ets (100%) rename ets2panda/test/runtime/ets/{ => fuzz}/too_many_call_expr.ets (100%) rename ets2panda/test/runtime/ets/{ => fuzz}/too_many_left_brace.ets (100%) rename ets2panda/test/runtime/ets/{ => fuzz}/too_many_left_square_brackets.ets (100%) rename ets2panda/test/runtime/ets/{ => fuzz}/too_many_new_expr.ets (100%) diff --git a/ets2panda/checker/ets/utilityTypeHandlers.cpp b/ets2panda/checker/ets/utilityTypeHandlers.cpp index 22cd11c5f0..48967c2d7d 100644 --- a/ets2panda/checker/ets/utilityTypeHandlers.cpp +++ b/ets2panda/checker/ets/utilityTypeHandlers.cpp @@ -38,6 +38,13 @@ std::optional ETSChecker::GetUtilityTypeTypeParamNode( return typeParams->Params().front(); } +static bool ValidBaseTypeOfRequiredAndPartial(Type *baseType) +{ + Type *type = baseType->MaybeBaseTypeOfGradualType(); + return type->IsETSObjectType() && (type->AsETSObjectType()->HasObjectFlag(ETSObjectFlags::INTERFACE) || + type->AsETSObjectType()->HasObjectFlag(ETSObjectFlags::CLASS)); +} + Type *ETSChecker::HandleUtilityTypeParameterNode(const ir::TSTypeParameterInstantiation *const typeParams, const ir::Identifier *const ident) { @@ -66,6 +73,13 @@ Type *ETSChecker::HandleUtilityTypeParameterNode(const ir::TSTypeParameterInstan return baseType; } + if ((utilityType == compiler::Signatures::PARTIAL_TYPE_NAME || + utilityType == compiler::Signatures::REQUIRED_TYPE_NAME) && + !ValidBaseTypeOfRequiredAndPartial(baseType)) { + LogError(diagnostic::MUST_BE_CLASS_INTERFACE_TYPE, {utilityType}, typeParams->Start()); + return GlobalTypeError(); + } + if (utilityType == compiler::Signatures::PARTIAL_TYPE_NAME) { // SUPPRESS_CSA_NEXTLINE(alpha.core.AllocatorETSCheckerHint) return CreatePartialType(baseType); diff --git a/ets2panda/test/ast/compiler/ets/Partial_utility_type_0.ets b/ets2panda/test/ast/compiler/ets/Partial_utility_type_0.ets new file mode 100644 index 0000000000..b72c198c60 --- /dev/null +++ b/ets2panda/test/ast/compiler/ets/Partial_utility_type_0.ets @@ -0,0 +1,32 @@ +/* + * 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 A {} +class B {} + +function foo() { + let x1: Partial = {} + let x2: Partial = {} + let x3: Partial = {} + let x4: Partial = {} + let x5: Partial = {} +} + + +/* @@? 20:20 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 21:20 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 22:20 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 23:20 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 24:20 Error TypeError: T in Partial must be a class or an interface type. */ diff --git a/ets2panda/test/ast/compiler/ets/Required_utility_type_0.ets b/ets2panda/test/ast/compiler/ets/Required_utility_type_0.ets new file mode 100644 index 0000000000..00fd2a2a6e --- /dev/null +++ b/ets2panda/test/ast/compiler/ets/Required_utility_type_0.ets @@ -0,0 +1,33 @@ +/* + * 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 A {} +class B {} + +function foo() { + let x1: Partial = {} + let x2: Partial = {} + let x3: Partial = {} + let x4: Partial = {} + let x5: Partial = {} +} + + + +/* @@? 20:20 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 21:20 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 22:20 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 23:20 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 24:20 Error TypeError: T in Partial must be a class or an interface type. */ diff --git a/ets2panda/test/ast/compiler/ets/partialTypeParameterParamInfer.ets b/ets2panda/test/ast/compiler/ets/partialTypeParameterParamInfer.ets new file mode 100644 index 0000000000..19aeb05f0b --- /dev/null +++ b/ets2panda/test/ast/compiler/ets/partialTypeParameterParamInfer.ets @@ -0,0 +1,18 @@ +/* + * 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 instanceof{ + a : string = "15"; +} diff --git a/ets2panda/test/ast/compiler/ets/partialType_check_in_RemoveUndefinedType.ets b/ets2panda/test/ast/compiler/ets/partialType_check_in_RemoveUndefinedType.ets index 2b6557074b..abe625355b 100644 --- a/ets2panda/test/ast/compiler/ets/partialType_check_in_RemoveUndefinedType.ets +++ b/ets2panda/test/ast/compiler/ets/partialType_check_in_RemoveUndefinedType.ets @@ -21,6 +21,7 @@ function main() { genericFunc<{a: number, b: string}>({a: 1}) } +/* @@? 16:35 Error TypeError: T in Partial must be a class or an interface type. */ /* @@? 21:3 Error TypeError: Bad operand type, the types of the operands must be numeric, same enumeration, or boolean type. */ /* @@? 21:15 Error TypeError: need to specify target type for class composite */ /* @@? 21:38 Error TypeError: need to specify target type for class composite */ diff --git a/ets2panda/test/ast/compiler/ets/requiredType_10_neg.ets b/ets2panda/test/ast/compiler/ets/requiredType_10_neg.ets index 98320d2d4c..cc8b0e626c 100644 --- a/ets2panda/test/ast/compiler/ets/requiredType_10_neg.ets +++ b/ets2panda/test/ast/compiler/ets/requiredType_10_neg.ets @@ -25,4 +25,4 @@ function main(): void { let req_a: A = {fld: /* @@ label */{}}; } -/* @@@ label Error TypeError: Class property 'b_fld' needs to be initialized for Required. */ +/* @@? 21:18 Error TypeError: T in Required must be a class or an interface type. */ diff --git a/ets2panda/test/ast/compiler/ets/union_type_of_partial_type.ets b/ets2panda/test/ast/compiler/ets/union_type_of_partial_type.ets index b024428363..e4ea92495b 100644 --- a/ets2panda/test/ast/compiler/ets/union_type_of_partial_type.ets +++ b/ets2panda/test/ast/compiler/ets/union_type_of_partial_type.ets @@ -21,6 +21,7 @@ abstract class A>{ /* @@? 16:9 Error SyntaxError: Parameter declaration should have an explicit type annotation. */ /* @@? 16:9 Error SyntaxError: Unexpected token, expected ',' or ')'. */ /* @@? 16:12 Error SyntaxError: Unexpected token ','. */ +/* @@? 16:27 Error TypeError: T in Partial must be a class or an interface type. */ /* @@? 16:42 Error SyntaxError: Unexpected token ')'. */ /* @@? 16:43 Error SyntaxError: Unexpected token ':'. */ /* @@? 16:45 Error SyntaxError: void is a predefined type, cannot be used as an identifier */ diff --git a/ets2panda/test/ast/compiler/ets/unresolve_class_with_type_infer.ets b/ets2panda/test/ast/compiler/ets/unresolve_class_with_type_infer.ets index 9347301cc3..472597e3c5 100644 --- a/ets2panda/test/ast/compiler/ets/unresolve_class_with_type_infer.ets +++ b/ets2panda/test/ast/compiler/ets/unresolve_class_with_type_infer.ets @@ -20,3 +20,6 @@ function foo>(record: Record>){ foo({}) /* @@? 16:39 Error TypeError: Cannot find type 'A'. */ +/* @@? 16:73 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 20:1 Error TypeError: No matching call signature for foo(...) */ +/* @@? 20:5 Error TypeError: need to specify target type for class composite */ diff --git a/ets2panda/test/ast/compiler/ets/utility_type_can_not_found_etsobjecttype.ets b/ets2panda/test/ast/compiler/ets/utility_type_can_not_found_etsobjecttype.ets index f549a860b8..dacc830f5d 100644 --- a/ets2panda/test/ast/compiler/ets/utility_type_can_not_found_etsobjecttype.ets +++ b/ets2panda/test/ast/compiler/ets/utility_type_can_not_found_etsobjecttype.ets @@ -26,4 +26,5 @@ class X { } /* @@? 16:34 Error TypeError: Cannot find type 'any'. */ -/* @@? 23:14 Error TypeError: Target type for class composite needs to be an object type, found 'T' */ \ No newline at end of file +/* @@? 21:29 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 23:14 Error TypeError: Target type for class composite needs to be an object type, found 'T' */ diff --git a/ets2panda/test/ast/parser/ets/partialType_4.ets b/ets2panda/test/ast/parser/ets/partialType_4.ets index 8cf429864d..138a81089d 100644 --- a/ets2panda/test/ast/parser/ets/partialType_4.ets +++ b/ets2panda/test/ast/parser/ets/partialType_4.ets @@ -79,4 +79,9 @@ class A>{ bar(initializers: Partial): void {} } -/* @@@ label Error TypeError: Type 'S' cannot be assigned to type 'T|undefined' */ +/* @@? 39:142 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 49:55 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 51:51 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 53:86 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 75:55 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 79:30 Error TypeError: T in Partial must be a class or an interface type. */ diff --git a/ets2panda/test/ast/parser/ets/partial_type_param1.ets b/ets2panda/test/ast/parser/ets/partial_type_param1.ets index de1e4ed9c5..0ff07bf635 100644 --- a/ets2panda/test/ast/parser/ets/partial_type_param1.ets +++ b/ets2panda/test/ast/parser/ets/partial_type_param1.ets @@ -36,4 +36,6 @@ function generic(t: Partial): boolean { function main() { // Test that {i: 1} is accepted as Partial generic({i: 1}); -} \ No newline at end of file +}/* @@? 32:41 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 38:5 Error TypeError: No matching call signature for generic(...) */ +/* @@? 38:17 Error TypeError: need to specify target type for class composite */ diff --git a/ets2panda/test/ast/parser/ets/partial_type_param2.ets b/ets2panda/test/ast/parser/ets/partial_type_param2.ets index e0ea578664..7dbb5c559d 100644 --- a/ets2panda/test/ast/parser/ets/partial_type_param2.ets +++ b/ets2panda/test/ast/parser/ets/partial_type_param2.ets @@ -34,4 +34,6 @@ function foo(i: Partial): number { function main() { // Test case: only 'i' is provided, 'j' is omitted foo({ i: 5 }); -} \ No newline at end of file +}/* @@? 21:37 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 36:3 Error TypeError: No matching call signature for foo(...) */ +/* @@? 36:10 Error TypeError: need to specify target type for class composite */ diff --git a/ets2panda/test/ast/parser/ets/type_from_utility_type.ets b/ets2panda/test/ast/parser/ets/type_from_utility_type.ets index fd5724ec64..dd7dd59374 100644 --- a/ets2panda/test/ast/parser/ets/type_from_utility_type.ets +++ b/ets2panda/test/ast/parser/ets/type_from_utility_type.ets @@ -33,6 +33,9 @@ } /* @@? 30:19 Error TypeError: Bad operand type, the types of the operands must be numeric, same enumeration, or boolean type. */ +/* @@? 17:37 Error TypeError: T in Partial must be a class or an interface type. */ +/* @@? 21:39 Error TypeError: T in Required must be a class or an interface type. */ +/* @@? 30:19 Error TypeError: Bad operand type, the types of the operands must be numeric, same enumeration, or boolean type. */ /* @@? 30:29 Error TypeError: No static $_invoke method and static $_instantiate method in Record. Record() is not allowed. */ /* @@? 30:29 Error TypeError: Type 'Record' has no call signatures. */ /* @@? 31:38 Error TypeError: Type argument 'Array' should be a subtype of 'Numeric|String|BaseEnum|BaseEnum|BaseEnum'-constraint */ diff --git a/ets2panda/test/benchmarks/bench_1.ets b/ets2panda/test/benchmarks/bench_1.ets index a200b8c29d..9803462714 100644 --- a/ets2panda/test/benchmarks/bench_1.ets +++ b/ets2panda/test/benchmarks/bench_1.ets @@ -415,7 +415,7 @@ function assert_o5(v: Object | null | undefined) { arktest.assertTrue(v !== null function assert_npe5(f: () => void) { try { f(); - } catch (e: NullPointerError) { + } catch (e) { return; } arktest.assertTrue(false, "npe was not thrown") @@ -761,16 +761,16 @@ function test_38(): void { // ----------------------------------------------- -class Class68 { +class Class68 { mmeb: Number = 2; - foo(a0: Partial){ + foo(a0: Partial){ if(this.mmeb == 3){ return; } this.bar(a0); } - bar(a0: Partial){ + bar(a0: Partial){ this.mmeb = 3; this.foo(a0); } @@ -778,15 +778,15 @@ class Class68 { class Class78 { fld: Number = 6;} -class Class88 { - baz(a0: Partial){ +class Class88 { + baz(a0: Partial){ a0.fld = undefined; } } function test_48(): void { let class7_partial: Partial = {fld: 8}; - let class6_original: Class68 = new Class68(); + let class6_original: Class68 = new Class68(); class6_original.foo(class7_partial); } @@ -818,7 +818,7 @@ function test_58(): void { class C33 { bar(): string { - return "Class C33"; + return ""; } } @@ -994,13 +994,14 @@ function bar35(x: C35|null|undefined, y: boolean, z: boolean): string { // SmartCast_06.ets // --------------------------------------------------------------------------------------------------------------------- -function foo36(x: int): string +function foo36(x: int): string | undefined { let rc: string|undefined = "default"; label1: switch(x) { case 0: rc = "case 0"; + break; case 1: { let rc1: string|undefined = ():string => {return "case 1";}(); label2: switch(rc) { @@ -1022,10 +1023,12 @@ function foo36(x: int): string break; case 4: rc = undefined; - default: - return rc != null ? rc :"case 4" + break; case 5: rc = "case 5"; + break; + default: + return rc != null ? rc :"case 4" } return rc; @@ -1047,10 +1050,12 @@ function foo37(flag37: boolean): int { if (flag37) { throw new Error(); } - } catch(ex: NullPointerError) { - z = 2; } catch(ex) { - w = undefined; + if (ex instanceof NullPointerError) { + z = 2; + } else { + w = undefined + } } return x + y! + z + w!; diff --git a/ets2panda/test/compiler/ets/requiredType_11-expected.txt b/ets2panda/test/compiler/ets/requiredType_11-expected.txt index 41e27345ba..4211a0eedd 100644 --- a/ets2panda/test/compiler/ets/requiredType_11-expected.txt +++ b/ets2panda/test/compiler/ets/requiredType_11-expected.txt @@ -1333,3 +1333,4 @@ } } } +TypeError: T in Required must be a class or an interface type. [requiredType_11.ets:21:18] diff --git a/ets2panda/test/compiler/ets/requiredType_9-expected.txt b/ets2panda/test/compiler/ets/requiredType_9-expected.txt index 2b7ed4053e..a80cb5e8d4 100644 --- a/ets2panda/test/compiler/ets/requiredType_9-expected.txt +++ b/ets2panda/test/compiler/ets/requiredType_9-expected.txt @@ -1743,3 +1743,5 @@ } } } +TypeError: T in Required must be a class or an interface type. [requiredType_9.ets:22:19] +TypeError: T in Required must be a class or an interface type. [requiredType_9.ets:23:19] diff --git a/ets2panda/test/runtime/ets/too_many_async.ets b/ets2panda/test/runtime/ets/fuzz/too_many_async.ets similarity index 100% rename from ets2panda/test/runtime/ets/too_many_async.ets rename to ets2panda/test/runtime/ets/fuzz/too_many_async.ets diff --git a/ets2panda/test/runtime/ets/too_many_await.ets b/ets2panda/test/runtime/ets/fuzz/too_many_await.ets similarity index 100% rename from ets2panda/test/runtime/ets/too_many_await.ets rename to ets2panda/test/runtime/ets/fuzz/too_many_await.ets diff --git a/ets2panda/test/runtime/ets/too_many_call_expr.ets b/ets2panda/test/runtime/ets/fuzz/too_many_call_expr.ets similarity index 100% rename from ets2panda/test/runtime/ets/too_many_call_expr.ets rename to ets2panda/test/runtime/ets/fuzz/too_many_call_expr.ets diff --git a/ets2panda/test/runtime/ets/too_many_left_brace.ets b/ets2panda/test/runtime/ets/fuzz/too_many_left_brace.ets similarity index 100% rename from ets2panda/test/runtime/ets/too_many_left_brace.ets rename to ets2panda/test/runtime/ets/fuzz/too_many_left_brace.ets diff --git a/ets2panda/test/runtime/ets/too_many_left_square_brackets.ets b/ets2panda/test/runtime/ets/fuzz/too_many_left_square_brackets.ets similarity index 100% rename from ets2panda/test/runtime/ets/too_many_left_square_brackets.ets rename to ets2panda/test/runtime/ets/fuzz/too_many_left_square_brackets.ets diff --git a/ets2panda/test/runtime/ets/too_many_new_expr.ets b/ets2panda/test/runtime/ets/fuzz/too_many_new_expr.ets similarity index 100% rename from ets2panda/test/runtime/ets/too_many_new_expr.ets rename to ets2panda/test/runtime/ets/fuzz/too_many_new_expr.ets diff --git a/ets2panda/test/runtime/ets/partialTypeRuntime_2.ets b/ets2panda/test/runtime/ets/partialTypeRuntime_2.ets index ceac96c37e..a59ba113ae 100644 --- a/ets2panda/test/runtime/ets/partialTypeRuntime_2.ets +++ b/ets2panda/test/runtime/ets/partialTypeRuntime_2.ets @@ -70,16 +70,16 @@ function test_3(): void { // ----------------------------------------------- -class Class6 { +class Class6 { mmeb: Number = 2; - foo(a0: Partial){ + foo(a0: Partial){ if(this.mmeb == 3){ return; } this.bar(a0); } - bar(a0: Partial){ + bar(a0: Partial){ this.mmeb = 3; this.foo(a0); } @@ -88,14 +88,14 @@ class Class6 { class Class7 { fld: Number = 6;} class Class8 { - baz(a0: Partial){ + baz(a0: Partial){ a0.fld = undefined; } } function test_4(): void { let class7_partial: Partial = {fld: 8}; - let class6_original: Class6 = new Class6(); + let class6_original: Class6 = new Class6(); class6_original.foo(class7_partial); } 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 8b450fcd32..91e2b0af73 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 @@ -25,7 +25,7 @@ as_string.ets function_type_with_receiver/extensionFunctionType_return_this.ets defaultExportObjectLiteral_exp.ets forOfCustomIterator3.ets -too_many_async.ets +fuzz/too_many_async.ets typeAlias_2.ets Multiline_string.ets Multiline_string_escape_char.ets diff --git a/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt b/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt index 536ae48707..1244e4746e 100644 --- a/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt +++ b/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt @@ -40,12 +40,6 @@ runtime/ets/type_param_in_union.ets runtime/ets/StringFasta.ets runtime/ets/struct-identifier.ets runtime/ets/struct-init2.ets -runtime/ets/too_many_call_expr.ets -runtime/ets/too_many_async.ets -runtime/ets/too_many_await.ets -runtime/ets/too_many_left_brace.ets -runtime/ets/too_many_left_square_brackets.ets -runtime/ets/too_many_new_expr.ets runtime/ets/too_many_minus.ets runtime/ets/too_many_plus.ets runtime/ets/too_many_plus_1.ets @@ -53,6 +47,11 @@ runtime/ets/too_many_tilde.ets runtime/ets/too_many_exclamation_mark.ets runtime/ets/fuzz/too_many_call_expr.ets runtime/ets/too_many_token.ets +runtime/ets/fuzz/too_many_async.ets +runtime/ets/fuzz/too_many_await.ets +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 ast/compiler/ets/DeclareIndexerTest.ets ast/parser/ets/import_tests/import_class_with_static_field/import_class_with_static_field.ets diff --git a/ets2panda/util/diagnostic/semantic.yaml b/ets2panda/util/diagnostic/semantic.yaml index d117696b1b..59ae05f940 100644 --- a/ets2panda/util/diagnostic/semantic.yaml +++ b/ets2panda/util/diagnostic/semantic.yaml @@ -976,6 +976,10 @@ semantic: id: 123 message: "Spread argument for the rest parameter can be only one." +- name: MUST_BE_CLASS_INTERFACE_TYPE + id: 124644 + message: "T in {} must be a class or an interface type." + - name: NAMESPACE_AS_TYPE id: 158 message: "Namespace '{}' cannot be used as a type." -- Gitee