From b4b73a5e74d9367041cdbf4e5190c9e22c1c406e Mon Sep 17 00:00:00 2001 From: Boglarka Haag Date: Thu, 26 Jun 2025 13:27:46 +0200 Subject: [PATCH] No indexed signatures are allowed Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICHTXP Reason: Uninformative error messages. Description: Modified parser to give better error messages. Changed back error message on indexer calls to a more informative one. Fixes internal issue: #23483 Signed-off-by: Haag Boglarka --- ets2panda/ir/expressions/memberExpression.cpp | 2 +- ets2panda/parser/ETSparser.cpp | 3 ++ ets2panda/parser/ETSparser.h | 1 + ets2panda/parser/ETSparserClasses.cpp | 24 +++++++++ ets2panda/parser/parserImpl.cpp | 50 +++++++++++++++++++ ets2panda/parser/parserImpl.h | 2 + .../ets/dynamic-field-declaration.ets | 2 +- .../not_constructible_types.ets | 2 +- .../ets/FixedArray/unexpected_token_31.ets | 2 +- .../test/ast/parser/ets/ambient_indexer_2.ets | 8 +-- .../ets/index_not_support_such_type.ets | 2 +- .../parser/ets/index_signature_error_1.ets | 27 ++++++++++ .../parser/ets/index_signature_error_2.ets | 27 ++++++++++ .../parser/ets/non-ambient_call_signature.ets | 3 +- .../parser/ets/non_proper_index_method.ets | 2 +- .../ets/recursive_exported_structure.ets | 9 +--- .../parser/ets/typenode_clone_brokentype.ets | 2 +- .../ast/parser/ets/unexpected_token_31.ets | 2 +- .../ast/parser/ets/unexpected_token_63.ets | 1 - .../ast/parser/ets/wrong_context_class_4.ets | 2 +- 20 files changed, 146 insertions(+), 27 deletions(-) create mode 100644 ets2panda/test/ast/parser/ets/index_signature_error_1.ets create mode 100644 ets2panda/test/ast/parser/ets/index_signature_error_2.ets diff --git a/ets2panda/ir/expressions/memberExpression.cpp b/ets2panda/ir/expressions/memberExpression.cpp index cc6fc7d172..6c0bc3f2ef 100644 --- a/ets2panda/ir/expressions/memberExpression.cpp +++ b/ets2panda/ir/expressions/memberExpression.cpp @@ -416,7 +416,7 @@ checker::Type *MemberExpression::CheckIndexAccessMethod(checker::ETSChecker *che isSetter ? compiler::Signatures::SET_INDEX_METHOD : compiler::Signatures::GET_INDEX_METHOD; auto *const method = objType_->GetProperty(methodName, searchFlag); if (method == nullptr || !method->HasFlag(varbinder::VariableFlags::METHOD)) { - checker->LogError(diagnostic::ERROR_ARKTS_NO_PROPERTIES_BY_INDEX, {}, Start()); + checker->LogError(diagnostic::NO_INDEX_ACCESS_METHOD, {}, Start()); return nullptr; } diff --git a/ets2panda/parser/ETSparser.cpp b/ets2panda/parser/ETSparser.cpp index 9e2059c27d..d5c9455fad 100644 --- a/ets2panda/parser/ETSparser.cpp +++ b/ets2panda/parser/ETSparser.cpp @@ -709,6 +709,9 @@ ir::AstNode *ETSParser::ParseInnerRest(const ArenaVector &propert Lexer()->NextToken(); return AllocBrokenStatement(rangeToken); } + if (memberName->IsErrorPlaceHolder()) { + return AllocBrokenStatement(startLoc); + } if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_PARENTHESIS || Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LESS_THAN) { diff --git a/ets2panda/parser/ETSparser.h b/ets2panda/parser/ETSparser.h index b9be64d56c..501ce1a0b3 100644 --- a/ets2panda/parser/ETSparser.h +++ b/ets2panda/parser/ETSparser.h @@ -229,6 +229,7 @@ private: ir::ModifierFlags ParseClassModifiers(); ir::ModifierFlags ParseInterfaceMethodModifiers(); ir::AstNode *ParseInterfaceField(); + void ParseIndexedSignature(); ir::TypeNode *ParseInterfaceTypeAnnotation(ir::Identifier *name); void ParseInterfaceModifiers(ir::ModifierFlags &fieldModifiers, bool &optionalField); ir::OverloadDeclaration *ParseInterfaceOverload(ir::ModifierFlags modifiers); diff --git a/ets2panda/parser/ETSparserClasses.cpp b/ets2panda/parser/ETSparserClasses.cpp index 8807006489..83986af1d2 100644 --- a/ets2panda/parser/ETSparserClasses.cpp +++ b/ets2panda/parser/ETSparserClasses.cpp @@ -1059,11 +1059,30 @@ void ETSParser::ParseInterfaceModifiers(ir::ModifierFlags &fieldModifiers, bool } } +void ETSParser::ParseIndexedSignature() +{ + ES2PANDA_ASSERT(Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_SQUARE_BRACKET); + Lexer()->NextToken(); + if (Lexer()->GetToken().Type() != lexer::TokenType::LITERAL_IDENT) { + return; + } + auto *name = AllocNode(Lexer()->GetToken().Ident(), Allocator()); + Lexer()->NextToken(); + ParseInterfaceTypeAnnotation(name); + + if (!Lexer()->TryEatTokenType(lexer::TokenType::PUNCTUATOR_RIGHT_SQUARE_BRACKET)) { + return; + } + Lexer()->NextToken(); + ParseInterfaceTypeAnnotation(name); +} + ir::AstNode *ETSParser::ParseInterfaceField() { ES2PANDA_ASSERT(Lexer()->GetToken().Type() == lexer::TokenType::LITERAL_IDENT || Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_SQUARE_BRACKET || Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_PARENTHESIS); + ir::ModifierFlags fieldModifiers = ir::ModifierFlags::PUBLIC; auto startLoc = Lexer()->GetToken().Start(); @@ -1082,6 +1101,11 @@ ir::AstNode *ETSParser::ParseInterfaceField() return property; } } + if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_SQUARE_BRACKET) { + ParseIndexedSignature(); + LogError(diagnostic::ERROR_ARKTS_NO_PROPERTIES_BY_INDEX, {}, startLoc); + return AllocBrokenExpression(Lexer()->GetToken().Start()); + } name->SetRange(Lexer()->GetToken().Loc()); Lexer()->NextToken(); diff --git a/ets2panda/parser/parserImpl.cpp b/ets2panda/parser/parserImpl.cpp index 47b031611b..0f26457e32 100644 --- a/ets2panda/parser/parserImpl.cpp +++ b/ets2panda/parser/parserImpl.cpp @@ -1253,6 +1253,51 @@ util::StringView ParserImpl::ParseSymbolIteratorIdentifier() const noexcept return util::StringView {compiler::Signatures::ITERATOR_METHOD}; } +void ParserImpl::EatTypeAnnotation() +{ + lexer_->NextToken(); // eat ':' or '|' + if (lexer_->GetToken().Type() != lexer::TokenType::LITERAL_IDENT) { + LogUnexpectedToken(lexer_->GetToken()); + auto pos = lexer_->Save(); + lexer_->NextToken(); + while (lexer_->GetToken().Type() != lexer::TokenType::LITERAL_IDENT) { + // just skip usls tokens, we have an identifier after + lexer_->Rewind(pos); + lexer_->NextToken(); + pos = lexer_->Save(); + } + if (lexer_->GetToken().Type() == lexer::TokenType::LITERAL_IDENT) { + // if next token is not an ident, so current token should be an identifier + // and we set it as literal ident + lexer_->GetToken().SetTokenType(lexer::TokenType::LITERAL_IDENT); + lexer_->GetToken().SetTokenStr(ERROR_LITERAL); + } + } + lexer_->NextToken(); // eat type + if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_BITWISE_OR) { + EatTypeAnnotation(); + } +} + +void ParserImpl::ParseIndexSignature() +{ + if (lexer_->GetToken().Type() != lexer::TokenType::LITERAL_IDENT) { + return; + } + lexer_->NextToken(); // eat param + + if (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_COLON) { + return; + } + + EatTypeAnnotation(); + + if (!lexer_->TryEatTokenType(lexer::TokenType::PUNCTUATOR_RIGHT_SQUARE_BRACKET)) { + return; + } + EatTypeAnnotation(); +} + ir::Identifier *ParserImpl::ExpectIdentifier([[maybe_unused]] bool isReference, bool isUserDefinedType, TypeAnnotationParsingOptions options) { @@ -1283,6 +1328,11 @@ ir::Identifier *ParserImpl::ExpectIdentifier([[maybe_unused]] bool isReference, } else if (tokenType == lexer::TokenType::PUNCTUATOR_LEFT_SQUARE_BRACKET) { // Special case for processing of special '[Symbol.iterator]` identifier using in stdlib. tokenName = ParseSymbolIteratorIdentifier(); + if (tokenName.Empty()) { + LogError(diagnostic::ERROR_ARKTS_NO_PROPERTIES_BY_INDEX, {}); + ParseIndexSignature(); + return AllocBrokenExpression(Lexer()->GetToken().Start()); + } } if (tokenName.Empty()) { diff --git a/ets2panda/parser/parserImpl.h b/ets2panda/parser/parserImpl.h index 169f3c2e7f..296541ebf9 100644 --- a/ets2panda/parser/parserImpl.h +++ b/ets2panda/parser/parserImpl.h @@ -241,6 +241,8 @@ protected: return false; } + void ParseIndexSignature(); + void EatTypeAnnotation(); util::StringView ParseSymbolIteratorIdentifier() const noexcept; ir::Identifier *ExpectIdentifier(bool isReference = false, bool isUserDefinedType = false, TypeAnnotationParsingOptions options = TypeAnnotationParsingOptions::REPORT_ERROR); diff --git a/ets2panda/test/ast/compiler/ets/dynamic-field-declaration.ets b/ets2panda/test/ast/compiler/ets/dynamic-field-declaration.ets index 1213452ed7..ad2a27ac6c 100644 --- a/ets2panda/test/ast/compiler/ets/dynamic-field-declaration.ets +++ b/ets2panda/test/ast/compiler/ets/dynamic-field-declaration.ets @@ -20,4 +20,4 @@ class Point { let p: Point = {x: 1, y: 2} console.log(p["x"]) -/* @@? 21:13 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ \ No newline at end of file +/* @@? 21:13 Error TypeError: Object type doesn't have proper index access method. */ \ No newline at end of file diff --git a/ets2panda/test/ast/compiler/ets/type_error_processing/not_constructible_types.ets b/ets2panda/test/ast/compiler/ets/type_error_processing/not_constructible_types.ets index 4341a3928c..46b03a8e16 100644 --- a/ets2panda/test/ast/compiler/ets/type_error_processing/not_constructible_types.ets +++ b/ets2panda/test/ast/compiler/ets/type_error_processing/not_constructible_types.ets @@ -34,6 +34,6 @@ WeakSet [12] = new undefined() /* @@? 19:1 Error TypeError: Type 'never' is not constructible. */ /* @@? 20:1 Error TypeError: This expression is not constructible. */ /* @@? 23:1 Error TypeError: The union type is not constructible. */ -/* @@? 26:1 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@? 26:1 Error TypeError: Object type doesn't have proper index access method. */ /* @@? 26:1 Error SyntaxError: Class cannot be used as object. */ /* @@? 26:16 Error TypeError: Type 'undefined' is not constructible. */ diff --git a/ets2panda/test/ast/parser/ets/FixedArray/unexpected_token_31.ets b/ets2panda/test/ast/parser/ets/FixedArray/unexpected_token_31.ets index ef1a3529d1..8190270528 100644 --- a/ets2panda/test/ast/parser/ets/FixedArray/unexpected_token_31.ets +++ b/ets2panda/test/ast/parser/ets/FixedArray/unexpected_token_31.ets @@ -28,5 +28,5 @@ function foo(...^number: FixedArray): int { /* @@? 16:48 Error SyntaxError: Unexpected token '{'. */ /* @@? 17:5 Error SyntaxError: return keyword should be used in function body. */ /* @@? 17:12 Error TypeError: Type name 'number' used in the wrong context */ -/* @@? 17:12 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@? 17:12 Error TypeError: Object type doesn't have proper index access method. */ /* @@? 17:12 Error TypeError: All return statements in the function should be empty or have a value. */ diff --git a/ets2panda/test/ast/parser/ets/ambient_indexer_2.ets b/ets2panda/test/ast/parser/ets/ambient_indexer_2.ets index 424271f881..d1c5273f0c 100644 --- a/ets2panda/test/ast/parser/ets/ambient_indexer_2.ets +++ b/ets2panda/test/ast/parser/ets/ambient_indexer_2.ets @@ -21,10 +21,4 @@ function main() { let a : A = new A(); } -/* @@? 17:6 Error SyntaxError: Unexpected token 'index'. */ -/* @@? 17:12 Error SyntaxError: Unexpected token ':'. */ -/* @@? 17:14 Error SyntaxError: number is a predefined type, cannot be used as an identifier */ -/* @@? 17:20 Error SyntaxError: Field type annotation expected. */ -/* @@? 17:20 Error SyntaxError: Unexpected token ']'. */ -/* @@? 17:22 Error SyntaxError: Unexpected token ':'. */ -/* @@? 17:30 Error SyntaxError: Field type annotation expected. */ +/* @@? 17:6 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ \ No newline at end of file diff --git a/ets2panda/test/ast/parser/ets/index_not_support_such_type.ets b/ets2panda/test/ast/parser/ets/index_not_support_such_type.ets index 5a82a6fe4a..c713e31333 100644 --- a/ets2panda/test/ast/parser/ets/index_not_support_such_type.ets +++ b/ets2panda/test/ast/parser/ets/index_not_support_such_type.ets @@ -26,4 +26,4 @@ function main() { /* @@? 18:5 Error TypeError: Call to `log` is ambiguous as `2` versions of `log` are available: `log(i: String): void` and `log(i: Long): void` */ /* @@? 18:5 Error TypeError: Call to `log` is ambiguous as `2` versions of `log` are available: `log(i: String): void` and `log(i: Float): void` */ /* @@? 18:5 Error TypeError: Call to `log` is ambiguous as `2` versions of `log` are available: `log(i: String): void` and `log(i: Double): void` */ -/* @@@ label Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@@ label Error TypeError: Object type doesn't have proper index access method. */ diff --git a/ets2panda/test/ast/parser/ets/index_signature_error_1.ets b/ets2panda/test/ast/parser/ets/index_signature_error_1.ets new file mode 100644 index 0000000000..1b35a8935c --- /dev/null +++ b/ets2panda/test/ast/parser/ets/index_signature_error_1.ets @@ -0,0 +1,27 @@ +/* + * 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 StringArray { + [/* @@ label1 */index: number]: string +} +function getStringArray(): StringArray { + return /* @@ label2 */["a", "b", "c"] +} +let myArray: StringArray = getStringArray() +let secondItem = /* @@ label3 */myArray[1] + +/* @@@ label1 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@@ label2 Error TypeError: Type 'Array' is not compatible with the enclosing method's return type 'StringArray' */ +/* @@@ label3 Error TypeError: Object type doesn't have proper index access method. */ diff --git a/ets2panda/test/ast/parser/ets/index_signature_error_2.ets b/ets2panda/test/ast/parser/ets/index_signature_error_2.ets new file mode 100644 index 0000000000..8eee907561 --- /dev/null +++ b/ets2panda/test/ast/parser/ets/index_signature_error_2.ets @@ -0,0 +1,27 @@ +/* + * 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 StringArray { + /* @@ label1 */[index: number]: string +} +function getStringArray(): StringArray { + return /* @@ label2 */["a", "b", "c"] +} +let myArray: StringArray = getStringArray() +let secondItem = /* @@ label3 */myArray[1] + +/* @@@ label1 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@@ label2 Error TypeError: Type 'Array' is not compatible with the enclosing method's return type 'StringArray' */ +/* @@@ label3 Error TypeError: Object type doesn't have proper index access method. */ diff --git a/ets2panda/test/ast/parser/ets/non-ambient_call_signature.ets b/ets2panda/test/ast/parser/ets/non-ambient_call_signature.ets index a2ab27116b..a61d358039 100644 --- a/ets2panda/test/ast/parser/ets/non-ambient_call_signature.ets +++ b/ets2panda/test/ast/parser/ets/non-ambient_call_signature.ets @@ -15,10 +15,9 @@ class A{ /* @@ label */(a:number/* @@ label1 */)/* @@ label2 */:number -/* @@ label3 */} +} /* @@@ label Error SyntaxError: Unexpected token '('. */ /* @@@ label1 Error SyntaxError: Unexpected token ')'. */ /* @@@ label2 Error SyntaxError: Unexpected token ':'. */ /* @@? 17:60 Error SyntaxError: number is a predefined type, cannot be used as an identifier */ -/* @@@ label3 Error SyntaxError: Field type annotation expected. */ diff --git a/ets2panda/test/ast/parser/ets/non_proper_index_method.ets b/ets2panda/test/ast/parser/ets/non_proper_index_method.ets index 33fbc6131a..49fbed1717 100644 --- a/ets2panda/test/ast/parser/ets/non_proper_index_method.ets +++ b/ets2panda/test/ast/parser/ets/non_proper_index_method.ets @@ -30,4 +30,4 @@ function main() { /* @@? 22:5 Error TypeError: Call to `log` is ambiguous as `2` versions of `log` are available: `log(i: String): void` and `log(i: Long): void` */ /* @@? 22:5 Error TypeError: Call to `log` is ambiguous as `2` versions of `log` are available: `log(i: String): void` and `log(i: Float): void` */ /* @@? 22:5 Error TypeError: Call to `log` is ambiguous as `2` versions of `log` are available: `log(i: String): void` and `log(i: Double): void` */ -/* @@@ label Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@@ label Error TypeError: Object type doesn't have proper index access method. */ diff --git a/ets2panda/test/ast/parser/ets/recursive_exported_structure.ets b/ets2panda/test/ast/parser/ets/recursive_exported_structure.ets index 2785b592bd..90fd2ccf79 100644 --- a/ets2panda/test/ast/parser/ets/recursive_exported_structure.ets +++ b/ets2panda/test/ast/parser/ets/recursive_exported_structure.ets @@ -98,12 +98,5 @@ export default _exported; /* @@? 62:12 Error SyntaxError: Label must be followed by a loop statement. */ /* @@? 62:12 Error TypeError: Type name 'IndexableType' used in the wrong context */ /* @@? 66:36 Error TypeError: Interfaces cannot extend classes, only other interfaces. */ -/* @@? 73:6 Error SyntaxError: Unexpected token 'key'. */ -/* @@? 73:9 Error SyntaxError: Unexpected token ':'. */ -/* @@? 73:17 Error SyntaxError: Field type annotation expected. */ -/* @@? 73:17 Error SyntaxError: Unexpected token ']'. */ -/* @@? 73:18 Error SyntaxError: Unexpected token ':'. */ -/* @@? 73:30 Error SyntaxError: Field type annotation expected. */ -/* @@? 73:31 Error SyntaxError: Unexpected token '|'. */ -/* @@? 73:46 Error SyntaxError: Field type annotation expected. */ +/* @@? 73:6 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ /* @@? 76:16 Error TypeError: Cannot cast type 'ExportedStructure' to 'Record Double|Record Double>>' */ diff --git a/ets2panda/test/ast/parser/ets/typenode_clone_brokentype.ets b/ets2panda/test/ast/parser/ets/typenode_clone_brokentype.ets index c3712f9c1f..f955112a64 100644 --- a/ets2panda/test/ast/parser/ets/typenode_clone_brokentype.ets +++ b/ets2panda/test/ast/parser/ets/typenode_clone_brokentype.ets @@ -53,7 +53,7 @@ declare const broken2: AnotherBroken; /* @@? 31:14 Error SyntaxError: Unexpected token ','. */ /* @@? 32:12 Error SyntaxError: Class cannot be used as object. */ /* @@? 32:12 Error SyntaxError: Label must be followed by a loop statement. */ -/* @@? 32:12 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@? 32:12 Error TypeError: Object type doesn't have proper index access method. */ /* @@? 36:27 Error TypeError: Cannot find type 'UndefinedInterface'. */ /* @@? 39:35 Error TypeError: Cannot find type 'any'. */ /* @@? 40:38 Error TypeError: Cannot find type 'any'. */ \ No newline at end of file diff --git a/ets2panda/test/ast/parser/ets/unexpected_token_31.ets b/ets2panda/test/ast/parser/ets/unexpected_token_31.ets index b545847e80..d7442c979c 100644 --- a/ets2panda/test/ast/parser/ets/unexpected_token_31.ets +++ b/ets2panda/test/ast/parser/ets/unexpected_token_31.ets @@ -28,5 +28,5 @@ function foo(...^number: int[]): int { /* @@? 16:38 Error SyntaxError: Unexpected token '{'. */ /* @@? 17:5 Error SyntaxError: return keyword should be used in function body. */ /* @@? 17:12 Error TypeError: Type name 'number' used in the wrong context */ -/* @@? 17:12 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@? 17:12 Error TypeError: Object type doesn't have proper index access method. */ /* @@? 17:12 Error TypeError: All return statements in the function should be empty or have a value. */ diff --git a/ets2panda/test/ast/parser/ets/unexpected_token_63.ets b/ets2panda/test/ast/parser/ets/unexpected_token_63.ets index ec6024e988..342f45a066 100644 --- a/ets2panda/test/ast/parser/ets/unexpected_token_63.ets +++ b/ets2panda/test/ast/parser/ets/unexpected_token_63.ets @@ -33,7 +33,6 @@ class A { /* @@? 17:29 Error SyntaxError: Unexpected token ':'. */ /* @@? 17:31 Error SyntaxError: number is a predefined type, cannot be used as an identifier */ /* @@? 17:37 Error SyntaxError: Unexpected token ')'. */ -/* @@? 17:37 Error SyntaxError: Field type annotation expected. */ /* @@? 17:39 Error SyntaxError: Unexpected token '{'. */ /* @@? 18:3 Error SyntaxError: Unexpected token 'while'. */ /* @@? 18:8 Error SyntaxError: Unexpected token '('. */ diff --git a/ets2panda/test/ast/parser/ets/wrong_context_class_4.ets b/ets2panda/test/ast/parser/ets/wrong_context_class_4.ets index 531f3707e9..79ccb2bf3b 100644 --- a/ets2panda/test/ast/parser/ets/wrong_context_class_4.ets +++ b/ets2panda/test/ast/parser/ets/wrong_context_class_4.ets @@ -26,5 +26,5 @@ function main() a[3] } -/* @@? 26:5 Error TypeError: Indexed signatures are not allowed. Use arrays instead! */ +/* @@? 26:5 Error TypeError: Object type doesn't have proper index access method. */ /* @@? 26:5 Error SyntaxError: Class cannot be used as object. */ -- Gitee