{ "type": "Program", "statements": [ { "type": "ClassDeclaration", "definition": { "id": { "type": "Identifier", "name": "A", "decorators": [], "loc": { "start": { "line": 16, "column": 7 }, "end": { "line": 16, "column": 8 } } }, "superClass": null, "implements": [], "body": [ { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "fun", "decorators": [], "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 22 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "fun", "decorators": [], "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 22 } } }, "generator": false, "async": false, "expression": false, "params": [], "returnType": { "type": "TSArrayType", "elementType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 29 } } }, "loc": { "start": { "line": 17, "column": 32 }, "end": { "line": 17, "column": 33 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ReturnStatement", "argument": { "type": "ETSNewArrayInstanceExpression", "typeReference": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 23 } } }, "dimension": { "type": "NumberLiteral", "value": 10, "loc": { "start": { "line": 18, "column": 24 }, "end": { "line": 18, "column": 26 } } }, "loc": { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 27 } } }, "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 28 } } } ], "loc": { "start": { "line": 17, "column": 32 }, "end": { "line": 19, "column": 6 } } }, "loc": { "start": { "line": 17, "column": 22 }, "end": { "line": 19, "column": 6 } } }, "loc": { "start": { "line": 17, "column": 22 }, "end": { "line": 19, "column": 6 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 19, "column": 6 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "constructor", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "kind": "constructor", "static": false, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "constructor", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "generator": false, "async": false, "expression": false, "params": [], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 20, "column": 2 }, "end": { "line": 20, "column": 2 } } } ], "loc": { "start": { "line": 16, "column": 9 }, "end": { "line": 20, "column": 2 } } }, "loc": { "start": { "line": 16, "column": 1 }, "end": { "line": 20, "column": 2 } } }, { "type": "ClassDeclaration", "definition": { "id": { "type": "Identifier", "name": "ETSGLOBAL", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "superClass": null, "implements": [], "body": [ { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "_$init$_", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "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 }, "end": { "line": 1, "column": 1 } } }, "generator": false, "async": false, "expression": false, "params": [], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "main", "decorators": [], "loc": { "start": { "line": 22, "column": 10 }, "end": { "line": 22, "column": 14 } } }, "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": 22, "column": 10 }, "end": { "line": 22, "column": 14 } } }, "generator": false, "async": false, "expression": false, "params": [], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, "column": 18 }, "end": { "line": 22, "column": 21 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "obj", "decorators": [], "loc": { "start": { "line": 23, "column": 9 }, "end": { "line": 23, "column": 12 } } }, "init": { "type": "ETSNewClassInstanceExpression", "typeReference": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "TSQualifiedName", "left": { "type": "Identifier", "name": "A", "decorators": [], "loc": { "start": { "line": 23, "column": 19 }, "end": { "line": 23, "column": 20 } } }, "right": { "type": "Identifier", "name": "fun", "decorators": [], "loc": { "start": { "line": 23, "column": 21 }, "end": { "line": 23, "column": 24 } } }, "loc": { "start": { "line": 23, "column": 19 }, "end": { "line": 23, "column": 25 } } }, "loc": { "start": { "line": 23, "column": 19 }, "end": { "line": 23, "column": 25 } } }, "loc": { "start": { "line": 23, "column": 19 }, "end": { "line": 23, "column": 25 } } }, "arguments": [], "loc": { "start": { "line": 23, "column": 15 }, "end": { "line": 23, "column": 27 } } }, "loc": { "start": { "line": 23, "column": 9 }, "end": { "line": 23, "column": 27 } } } ], "kind": "let", "loc": { "start": { "line": 23, "column": 5 }, "end": { "line": 23, "column": 27 } } }, { "type": "ReturnStatement", "argument": { "type": "NumberLiteral", "value": 0, "loc": { "start": { "line": 24, "column": 12 }, "end": { "line": 24, "column": 13 } } }, "loc": { "start": { "line": 24, "column": 5 }, "end": { "line": 24, "column": 14 } } } ], "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 25, "column": 2 } } }, "loc": { "start": { "line": 22, "column": 14 }, "end": { "line": 25, "column": 2 } } }, "loc": { "start": { "line": 22, "column": 14 }, "end": { "line": 25, "column": 2 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 22, "column": 1 }, "end": { "line": 25, "column": 2 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 26, "column": 1 } } } TypeError: 'fun' type does not exist. [newClassInstanceExpression.ets:23:21]