diff --git a/ets2panda/checker/ets/utilityTypeHandlers.cpp b/ets2panda/checker/ets/utilityTypeHandlers.cpp index 22cd11c5f0b9425aa8162f082780511978759540..48967c2d7d01beb6bbf9c480c48fb590f833c00d 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 0000000000000000000000000000000000000000..b72c198c605052e4f6589d7b3d89bd93663db680 --- /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 0000000000000000000000000000000000000000..00fd2a2a6e27e1da5b191c8875782731d22a791c --- /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 0000000000000000000000000000000000000000..19aeb05f0b5911ee21e006696ae7fbd91d55c24d --- /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 2b6557074b07ccbedd8b296b0c99f794a80e98c9..abe625355b83a683c9fa7ee6b74220d7e7bc1de0 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 98320d2d4ce205791760ad66c13b7a6bfb36b365..cc8b0e626ca83e7cf5c1a0c85589709f8bded498 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 b024428363cc3f69df19ac62f9c781c0332e5f3f..e4ea92495b82b4c51bb4f9c482368c1fc0edba7c 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 9347301cc3f96cac0dba997c2b30dd0fec9a5b9e..472597e3c531be5f6c8824116dfa8a1217156688 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 f549a860b8ab50e6349d41dcc5729825bdb46024..dacc830f5d11bc033b978db592a19c6cc8dd35c9 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 8cf429864d6297082d81862624ed49379eee2e35..138a81089d6ff0da4679186406e0ce935caab563 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 de1e4ed9c53f306497097be4b73b822f039067ce..0ff07bf635902a8bde714b6eae5170e586c9577a 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 e0ea578664753a4d4169f538f75324157538eda3..7dbb5c559d86caf893bcae792c7a25b24ee8142a 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 fd5724ec64144391b1b695595763a83ec5370f82..dd7dd59374f7b8d5957cc0806b7d318a3f341edd 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 a200b8c29d28a7b0b7332f96f72f3e5dbe958c30..9803462714ebd80a6674beca0344537b0ec1b8b7 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 41e27345ba492fd631ba8f586d432b425cd9c39f..4211a0eeddb1b7ccea45b5400a25c62495f05a2d 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 2b7ed4053ec366dbb518a6dcca46e30c5f78d359..a80cb5e8d43fa76bc0acc6479968f22cf775ce28 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 ceac96c37e0fe1e3800526653b7c5dfe1f940f18..a59ba113aeb9fb19ddf4190bf40d7d52b68cc9d4 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 8b450fcd32da9b696f82c8e45cd6044cb86663ba..91e2b0af730ae0cd8eb48da252d759b2eda18c8d 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 536ae48707c490a5d7ffc56799c13324dd0af4af..1244e4746e4557a6495a8339013dfc432075abd0 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 d117696b1bb01e1ee75770cd571cc637b92b9fe7..59ae05f94042fbdb281d9ddce60f26883f8beac7 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."