{ "type": "Program", "statements": [ { "type": "ClassDeclaration", "definition": { "id": { "type": "Identifier", "name": "Tup", "decorators": [], "loc": { "start": { "line": 18, "column": 7 }, "end": { "line": 18, "column": 10 } } }, "typeParameters": { "type": "TSTypeParameterDeclaration", "params": [ { "type": "TSTypeParameter", "name": { "type": "Identifier", "name": "A", "decorators": [], "loc": { "start": { "line": 18, "column": 11 }, "end": { "line": 18, "column": 12 } } }, "loc": { "start": { "line": 18, "column": 11 }, "end": { "line": 18, "column": 13 } } }, { "type": "TSTypeParameter", "name": { "type": "Identifier", "name": "B", "decorators": [], "loc": { "start": { "line": 18, "column": 14 }, "end": { "line": 18, "column": 15 } } }, "loc": { "start": { "line": 18, "column": 14 }, "end": { "line": 18, "column": 16 } } } ], "loc": { "start": { "line": 18, "column": 10 }, "end": { "line": 18, "column": 16 } } }, "superClass": null, "implements": [], "body": [ { "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": 18, "column": 19 }, "end": { "line": 18, "column": 19 } } } ], "loc": { "start": { "line": 18, "column": 17 }, "end": { "line": 18, "column": 19 } } }, "loc": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 19 } } }, { "type": "ClassDeclaration", "definition": { "id": { "type": "Identifier", "name": "Tup2", "decorators": [], "loc": { "start": { "line": 19, "column": 7 }, "end": { "line": 19, "column": 11 } } }, "typeParameters": { "type": "TSTypeParameterDeclaration", "params": [ { "type": "TSTypeParameter", "name": { "type": "Identifier", "name": "A", "decorators": [], "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 19, "column": 13 } } }, "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 19, "column": 14 } } } ], "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 19, "column": 14 } } }, "superClass": null, "implements": [], "body": [ { "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": 19, "column": 17 }, "end": { "line": 19, "column": 17 } } } ], "loc": { "start": { "line": 19, "column": 15 }, "end": { "line": 19, "column": 17 } } }, "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 19, "column": 17 } } }, { "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": "foo", "decorators": [], "loc": { "start": { "line": 16, "column": 10 }, "end": { "line": 16, "column": 13 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 16, "column": 10 }, "end": { "line": 16, "column": 13 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "x", "typeAnnotation": { "type": "ETSFunctionType", "params": [], "returnType": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "T", "decorators": [], "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 27 } } }, "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 28 } } }, "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 28 } } }, "loc": { "start": { "line": 16, "column": 20 }, "end": { "line": 16, "column": 28 } } }, "decorators": [], "loc": { "start": { "line": 16, "column": 17 }, "end": { "line": 16, "column": 28 } } }, "loc": { "start": { "line": 16, "column": 17 }, "end": { "line": 16, "column": 28 } } } ], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 30 }, "end": { "line": 16, "column": 34 } } }, "typeParameters": { "type": "TSTypeParameterDeclaration", "params": [ { "type": "TSTypeParameter", "name": { "type": "Identifier", "name": "T", "decorators": [], "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 15 } } }, "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 16 } } } ], "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 16 } } }, "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 16, "column": 35 }, "end": { "line": 16, "column": 37 } } }, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 37 } } }, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 37 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 16, "column": 1 }, "end": { "line": 16, "column": 37 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "main", "decorators": [], "loc": { "start": { "line": 21, "column": 10 }, "end": { "line": 21, "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": 21, "column": 10 }, "end": { "line": 21, "column": 14 } } }, "generator": false, "async": false, "expression": false, "params": [], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, "column": 18 }, "end": { "line": 21, "column": 22 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 22, "column": 3 }, "end": { "line": 22, "column": 6 } } }, "arguments": [ { "type": "ArrowFunctionExpression", "function": { "type": "ScriptFunction", "id": null, "generator": false, "async": false, "expression": false, "params": [], "returnType": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Tup", "decorators": [], "loc": { "start": { "line": 22, "column": 38 }, "end": { "line": 22, "column": 41 } } }, "typeParams": { "type": "TSTypeParameterInstantiation", "params": [ { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "number", "decorators": [], "loc": { "start": { "line": 22, "column": 42 }, "end": { "line": 22, "column": 48 } } }, "loc": { "start": { "line": 22, "column": 42 }, "end": { "line": 22, "column": 49 } } }, "loc": { "start": { "line": 22, "column": 42 }, "end": { "line": 22, "column": 49 } } }, { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Tup2", "decorators": [], "loc": { "start": { "line": 22, "column": 50 }, "end": { "line": 22, "column": 54 } } }, "typeParams": { "type": "TSTypeParameterInstantiation", "params": [ { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "number", "decorators": [], "loc": { "start": { "line": 22, "column": 55 }, "end": { "line": 22, "column": 61 } } }, "loc": { "start": { "line": 22, "column": 55 }, "end": { "line": 22, "column": 63 } } }, "loc": { "start": { "line": 22, "column": 55 }, "end": { "line": 22, "column": 63 } } } ], "loc": { "start": { "line": 22, "column": 54 }, "end": { "line": 22, "column": 63 } } }, "loc": { "start": { "line": 22, "column": 50 }, "end": { "line": 22, "column": 63 } } }, "loc": { "start": { "line": 22, "column": 50 }, "end": { "line": 22, "column": 63 } } } ], "loc": { "start": { "line": 22, "column": 41 }, "end": { "line": 22, "column": 63 } } }, "loc": { "start": { "line": 22, "column": 38 }, "end": { "line": 22, "column": 66 } } }, "loc": { "start": { "line": 22, "column": 38 }, "end": { "line": 22, "column": 66 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ThrowStatement", "argument": { "type": "ETSNewClassInstanceExpression", "typeReference": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Error", "decorators": [], "loc": { "start": { "line": 22, "column": 79 }, "end": { "line": 22, "column": 84 } } }, "loc": { "start": { "line": 22, "column": 79 }, "end": { "line": 22, "column": 85 } } }, "loc": { "start": { "line": 22, "column": 79 }, "end": { "line": 22, "column": 85 } } }, "arguments": [], "loc": { "start": { "line": 22, "column": 75 }, "end": { "line": 22, "column": 88 } } }, "loc": { "start": { "line": 22, "column": 69 }, "end": { "line": 22, "column": 88 } } } ], "loc": { "start": { "line": 22, "column": 67 }, "end": { "line": 22, "column": 88 } } }, "loc": { "start": { "line": 22, "column": 34 }, "end": { "line": 22, "column": 88 } } }, "loc": { "start": { "line": 22, "column": 34 }, "end": { "line": 22, "column": 88 } } } ], "optional": false, "typeParameters": { "type": "TSTypeParameterInstantiation", "params": [ { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Tup", "decorators": [], "loc": { "start": { "line": 22, "column": 7 }, "end": { "line": 22, "column": 10 } } }, "typeParams": { "type": "TSTypeParameterInstantiation", "params": [ { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "number", "decorators": [], "loc": { "start": { "line": 22, "column": 11 }, "end": { "line": 22, "column": 17 } } }, "loc": { "start": { "line": 22, "column": 11 }, "end": { "line": 22, "column": 18 } } }, "loc": { "start": { "line": 22, "column": 11 }, "end": { "line": 22, "column": 18 } } }, { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Tup2", "decorators": [], "loc": { "start": { "line": 22, "column": 19 }, "end": { "line": 22, "column": 23 } } }, "typeParams": { "type": "TSTypeParameterInstantiation", "params": [ { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "number", "decorators": [], "loc": { "start": { "line": 22, "column": 24 }, "end": { "line": 22, "column": 30 } } }, "loc": { "start": { "line": 22, "column": 24 }, "end": { "line": 22, "column": 33 } } }, "loc": { "start": { "line": 22, "column": 24 }, "end": { "line": 22, "column": 33 } } } ], "loc": { "start": { "line": 22, "column": 23 }, "end": { "line": 22, "column": 33 } } }, "loc": { "start": { "line": 22, "column": 19 }, "end": { "line": 22, "column": 33 } } }, "loc": { "start": { "line": 22, "column": 19 }, "end": { "line": 22, "column": 33 } } } ], "loc": { "start": { "line": 22, "column": 10 }, "end": { "line": 22, "column": 33 } } }, "loc": { "start": { "line": 22, "column": 7 }, "end": { "line": 22, "column": 33 } } }, "loc": { "start": { "line": 22, "column": 7 }, "end": { "line": 22, "column": 33 } } } ], "loc": { "start": { "line": 22, "column": 6 }, "end": { "line": 22, "column": 33 } } }, "loc": { "start": { "line": 22, "column": 3 }, "end": { "line": 22, "column": 89 } } }, "loc": { "start": { "line": 22, "column": 3 }, "end": { "line": 22, "column": 90 } } } ], "loc": { "start": { "line": 21, "column": 23 }, "end": { "line": 23, "column": 2 } } }, "loc": { "start": { "line": 21, "column": 14 }, "end": { "line": 23, "column": 2 } } }, "loc": { "start": { "line": 21, "column": 14 }, "end": { "line": 23, "column": 2 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 21, "column": 1 }, "end": { "line": 23, "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": 25, "column": 1 } } }