diff --git a/ets2panda/test/ast/compiler/ets/override18.ets b/ets2panda/test/ast/compiler/ets/override18.ets deleted file mode 100644 index cb85ef104d88734232d9d5a6afa00676e3d3ec84..0000000000000000000000000000000000000000 --- a/ets2panda/test/ast/compiler/ets/override18.ets +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2023-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 J{ - toString(): String { - return ""; - } - $_hashCode():int{ - return 4; - } -} - -class JImpl implements J{ -} - -function main(): void { - let o: JImpl = new JImpl() - arktest.assertEQ(o.$_hashCode(), 4); -} diff --git a/ets2panda/test/compiler/ets/override19-expected.txt b/ets2panda/test/compiler/ets/override19-expected.txt deleted file mode 100644 index 41840f86e8559f22e4b48f3c4dce72e7de859364..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/override19-expected.txt +++ /dev/null @@ -1,1317 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "O", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 7, - "program": "override19.ets" - }, - "end": { - "line": 16, - "column": 8, - "program": "override19.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "toString", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 14, - "program": "override19.ets" - }, - "end": { - "line": 17, - "column": 22, - "program": "override19.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "toString", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 14, - "program": "override19.ets" - }, - "end": { - "line": 17, - "column": 22, - "program": "override19.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "String", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 26, - "program": "override19.ets" - }, - "end": { - "line": 17, - "column": 32, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 26, - "program": "override19.ets" - }, - "end": { - "line": 17, - "column": 34, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 26, - "program": "override19.ets" - }, - "end": { - "line": 17, - "column": 34, - "program": "override19.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "StringLiteral", - "value": "", - "loc": { - "start": { - "line": 18, - "column": 16, - "program": "override19.ets" - }, - "end": { - "line": 18, - "column": 18, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 18, - "column": 19, - "program": "override19.ets" - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 33, - "program": "override19.ets" - }, - "end": { - "line": 19, - "column": 6, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 19, - "column": 6, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 19, - "column": 6, - "program": "override19.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "override19.ets" - }, - "end": { - "line": 19, - "column": 6, - "program": "override19.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "$_hashCode", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 14, - "program": "override19.ets" - }, - "end": { - "line": 20, - "column": 24, - "program": "override19.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "$_hashCode", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 14, - "program": "override19.ets" - }, - "end": { - "line": 20, - "column": 24, - "program": "override19.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 28, - "program": "override19.ets" - }, - "end": { - "line": 20, - "column": 31, - "program": "override19.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 21, - "column": 16, - "program": "override19.ets" - }, - "end": { - "line": 21, - "column": 17, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 21, - "column": 18, - "program": "override19.ets" - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 32, - "program": "override19.ets" - }, - "end": { - "line": 22, - "column": 6, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 24, - "program": "override19.ets" - }, - "end": { - "line": 22, - "column": 6, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 24, - "program": "override19.ets" - }, - "end": { - "line": 22, - "column": 6, - "program": "override19.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5, - "program": "override19.ets" - }, - "end": { - "line": 22, - "column": 6, - "program": "override19.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 16, - "column": 9, - "program": "override19.ets" - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 16, - "column": 9, - "program": "override19.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 16, - "column": 9, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 16, - "column": 9, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 16, - "column": 9, - "program": "override19.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 8, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 6, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 6, - "program": "override19.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "OExt", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 7, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 11, - "program": "override19.ets" - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "O", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 20, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 21, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 20, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 22, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 20, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 22, - "program": "override19.ets" - } - } - }, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 22, - "program": "override19.ets" - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 22, - "program": "override19.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 25, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 22, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 22, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 25, - "column": 22, - "program": "override19.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 21, - "program": "override19.ets" - }, - "end": { - "line": 28, - "column": 9, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 28, - "column": 9, - "program": "override19.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "override19.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "override19.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "override19.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 10, - "program": "override19.ets" - }, - "end": { - "line": 28, - "column": 14, - "program": "override19.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 10, - "program": "override19.ets" - }, - "end": { - "line": 28, - "column": 14, - "program": "override19.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 28, - "column": 18, - "program": "override19.ets" - }, - "end": { - "line": 28, - "column": 22, - "program": "override19.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "o", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "OExt", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 12, - "program": "override19.ets" - }, - "end": { - "line": 29, - "column": 16, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 12, - "program": "override19.ets" - }, - "end": { - "line": 29, - "column": 18, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 12, - "program": "override19.ets" - }, - "end": { - "line": 29, - "column": 18, - "program": "override19.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 29, - "column": 10, - "program": "override19.ets" - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "OExt", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 23, - "program": "override19.ets" - }, - "end": { - "line": 29, - "column": 27, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 23, - "program": "override19.ets" - }, - "end": { - "line": 29, - "column": 28, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 23, - "program": "override19.ets" - }, - "end": { - "line": 29, - "column": 28, - "program": "override19.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 29, - "column": 19, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 12, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 9, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 12, - "program": "override19.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 29, - "column": 5, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 12, - "program": "override19.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "arktest", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 12, - "program": "override19.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "assertEQ", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 13, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 21, - "program": "override19.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 21, - "program": "override19.ets" - } - } - }, - "arguments": [ - { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "o", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 23, - "program": "override19.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "$_hashCode", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 24, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 34, - "program": "override19.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 34, - "program": "override19.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 22, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 36, - "program": "override19.ets" - } - } - }, - { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 30, - "column": 38, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 39, - "program": "override19.ets" - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 40, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "override19.ets" - }, - "end": { - "line": 30, - "column": 41, - "program": "override19.ets" - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 23, - "program": "override19.ets" - }, - "end": { - "line": 31, - "column": 2, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 10, - "program": "override19.ets" - }, - "end": { - "line": 31, - "column": 2, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 10, - "program": "override19.ets" - }, - "end": { - "line": 31, - "column": 2, - "program": "override19.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 31, - "column": 2, - "program": "override19.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "override19.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "override19.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "override19.ets" - }, - "end": { - "line": 32, - "column": 1, - "program": "override19.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/override19.ets b/ets2panda/test/compiler/ets/override19.ets deleted file mode 100644 index 168e38f49c9056dea6f3b876c4477b4b313447eb..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/override19.ets +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2023-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 O{ - override toString(): String { - return ""; - } - override $_hashCode(): int { - return 4; - } -} - -class OExt extends O{ -} - -function main(): void { - let o: OExt = new OExt() - arktest.assertEQ(o.$_hashCode(), 4); -}