diff --git a/ets2panda/checker/ets/function.cpp b/ets2panda/checker/ets/function.cpp index 6556eadc3faf4cc4012a55b81a31baf93000ef15..be11e67cd6ff5b83acb5467d456835d997f07dd0 100644 --- a/ets2panda/checker/ets/function.cpp +++ b/ets2panda/checker/ets/function.cpp @@ -1252,6 +1252,11 @@ static bool CollectOverload(checker::ETSChecker *checker, ir::MethodDefinition * methodId->Variable()->SetTsType(checker->GlobalTypeError()); return false; } + if (currentFunc->Function()->IsAsyncFunc() != method->Function()->IsAsyncFunc()) { + checker->LogDiagnostic(diagnostic::OVERLOAD_SAME_ACCESS_MODIFIERS_STATIC_ASYNC, {}, currentFunc->Start()); + return false; + } + auto *const overloadType = checker->BuildMethodType(currentFunc->Function()); ldInfo.needHelperOverload |= checker->CheckIdenticalOverloads(funcType, overloadType, currentFunc, ldInfo.isDeclare); diff --git a/ets2panda/compiler/lowering/ets/asyncMethodLowering.cpp b/ets2panda/compiler/lowering/ets/asyncMethodLowering.cpp index 01d054a71719af0a6a204e77f7e8f90baa2264f2..505a61df6fe885a30dc56f56087cb488d220e8c7 100644 --- a/ets2panda/compiler/lowering/ets/asyncMethodLowering.cpp +++ b/ets2panda/compiler/lowering/ets/asyncMethodLowering.cpp @@ -175,7 +175,8 @@ void ComposeAsyncImplMethod(checker::ETSChecker *checker, ir::MethodDefinition * ES2PANDA_ASSERT(node->Function() != nullptr); if (node->Function()->IsOverload()) { auto *baseOverloadImplMethod = node->BaseOverloadMethod()->AsyncPairMethod(); - ES2PANDA_ASSERT(implMethod->Function() != nullptr && baseOverloadImplMethod->Function() != nullptr); + ES2PANDA_ASSERT(implMethod->Function() != nullptr); + ES2PANDA_ASSERT(baseOverloadImplMethod != nullptr && baseOverloadImplMethod->Function() != nullptr); implMethod->Function()->Id()->SetVariable(baseOverloadImplMethod->Function()->Id()->Variable()); baseOverloadImplMethod->AddOverload(implMethod); } else { diff --git a/ets2panda/test/compiler/ets/methodOverrideAsyncMethod.ets b/ets2panda/test/ast/parser/ets/overload_sync_async.ets similarity index 33% rename from ets2panda/test/compiler/ets/methodOverrideAsyncMethod.ets rename to ets2panda/test/ast/parser/ets/overload_sync_async.ets index 1555684735aafc93f941331838dcddc41c722e00..d3e7c0f0947619a66308c62f84965c3189a948eb 100644 --- a/ets2panda/test/compiler/ets/methodOverrideAsyncMethod.ets +++ b/ets2panda/test/ast/parser/ets/overload_sync_async.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * 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 @@ -13,20 +13,30 @@ * limitations under the License. */ -class A { - regularFunc1(param: () => boolean): Promise { - return Promise.resolve(true); - } +class Test { + regularFunc(): boolean { + return true; + } - regularFunc1(): boolean { - return true; - } + async regularFunc(param: () => boolean): Promise { + return param(); + } - async regularFunc2(param: () => boolean): Promise { - return Promise.resolve(true); - } + callOverloadRegularFunc(): void { + let is_call_regular_func1 = await this.regularFunc((): boolean => { return true }); + arktest.assertEQ(is_call_regular_func1, true) - regularFunc2(): boolean { - return true; - } + let is_call_regular_func2 = await this.regularFunc((): boolean => { return false }); + arktest.assertEQ(is_call_regular_func2, false) + } } + +function main(): void { + new Test().callOverloadRegularFunc(); +} + +/* @@? 21:5 Error TypeError: Overload alias and overloaded method name must have exactly the same modifiers (static, async). */ +/* @@? 26:43 Error TypeError: 'await' expressions require Promise object as argument. */ +/* @@? 26:48 Error TypeError: Property 'regularFunc' does not exist on type 'Test' */ +/* @@? 29:43 Error TypeError: 'await' expressions require Promise object as argument. */ +/* @@? 29:48 Error TypeError: Property 'regularFunc' does not exist on type 'Test' */ diff --git a/ets2panda/test/compiler/ets/methodOverrideAsyncMethod-expected.txt b/ets2panda/test/compiler/ets/methodOverrideAsyncMethod-expected.txt deleted file mode 100644 index a3889c32e118b57c07973df1c82a2ed63a70773d..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/methodOverrideAsyncMethod-expected.txt +++ /dev/null @@ -1,1506 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 7, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 16, - "column": 8, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "regularFunc1", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "regularFunc1", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 17, - "column": 29, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 36, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 36, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 16, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 36, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 36, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Promise", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 39, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 46, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "typeParams": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 17, - "column": 47, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 54, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 46, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 55, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 39, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 57, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 39, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 17, - "column": 57, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Promise", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 12, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 18, - "column": 19, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "resolve", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 20, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 18, - "column": 27, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 12, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 18, - "column": 27, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "arguments": [ - { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 18, - "column": 37, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 18, - "column": 41, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "optional": false, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 28, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 18, - "column": 35, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 27, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 18, - "column": 36, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 18, - "column": 42, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 18, - "column": 43, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 56, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 19, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 19, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 19, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "overloads": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "regularFunc1", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 21, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "regularFunc1", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 21, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 21, - "column": 19, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 21, - "column": 26, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 22, - "column": 12, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 22, - "column": 16, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 22, - "column": 17, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 27, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 19, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "regularFunc2", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 21, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "regularFunc2", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 21, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "generator": false, - "async": true, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 25, - "column": 35, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 42, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 29, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 42, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 22, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 42, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 22, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 42, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Promise", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 45, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 52, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "typeParams": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 25, - "column": 53, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 60, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 52, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 61, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 45, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 63, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 45, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 25, - "column": 63, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Promise", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 12, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 26, - "column": 19, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "resolve", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 20, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 26, - "column": 27, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 12, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 26, - "column": 27, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "arguments": [ - { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 26, - "column": 37, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 26, - "column": 41, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "optional": false, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 26, - "column": 28, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 26, - "column": 35, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 27, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 26, - "column": 36, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 12, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 26, - "column": 42, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 26, - "column": 43, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 62, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 27, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 21, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 27, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 21, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 27, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "overloads": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "regularFunc2", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 29, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "regularFunc2", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 29, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 29, - "column": 19, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 29, - "column": 26, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 30, - "column": 12, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 30, - "column": 16, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 30, - "column": 17, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 27, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 31, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 31, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 15, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 31, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 31, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 3, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 27, - "column": 4, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.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": 10, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 16, - "column": 10, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 9, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 33, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 33, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "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": "main", - "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": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - { - "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": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - }, - "end": { - "line": 33, - "column": 1, - "program": "methodOverrideAsyncMethod.ets" - } - } -}