swc/crates/swc_ecma_parser/tests/tsc/functionLiteralForOverloads.json

1020 lines
32 KiB
JSON

{
"type": "Script",
"span": {
"start": 52,
"end": 347,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 52,
"end": 124,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 56,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": "f",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 57,
"end": 112,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 59,
"end": 112,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 65,
"end": 85,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 66,
"end": 75,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 67,
"end": 75,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 69,
"end": 75,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 76,
"end": 84,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 78,
"end": 84,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 90,
"end": 110,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 91,
"end": 100,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 92,
"end": 100,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 94,
"end": 100,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 101,
"end": 109,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 103,
"end": 109,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 115,
"end": 123,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "x",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 126,
"end": 205,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 130,
"end": 204,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 130,
"end": 132,
"ctxt": 0
},
"value": "f2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 132,
"end": 193,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 134,
"end": 193,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 140,
"end": 163,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 144,
"end": 153,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 145,
"end": 153,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 147,
"end": 153,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 154,
"end": 162,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 156,
"end": 162,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 140,
"end": 143,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 168,
"end": 191,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 172,
"end": 181,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 173,
"end": 181,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 175,
"end": 181,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 182,
"end": 190,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 184,
"end": 190,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
}
}
]
}
}
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 196,
"end": 204,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 203,
"end": 204,
"ctxt": 0
},
"value": "x",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 207,
"end": 276,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 211,
"end": 275,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 211,
"end": 213,
"ctxt": 0
},
"value": "f3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 213,
"end": 264,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 215,
"end": 264,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 221,
"end": 239,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 225,
"end": 229,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 226,
"end": 229,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 230,
"end": 238,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 232,
"end": 238,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 221,
"end": 224,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 244,
"end": 262,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 248,
"end": 252,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 249,
"end": 252,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 253,
"end": 261,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 255,
"end": 261,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 244,
"end": 247,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 245,
"end": 246,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 245,
"end": 246,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
}
}
]
}
}
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 267,
"end": 275,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 274,
"end": 275,
"ctxt": 0
},
"value": "x",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 278,
"end": 347,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 282,
"end": 346,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 282,
"end": 284,
"ctxt": 0
},
"value": "f4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 284,
"end": 335,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 286,
"end": 335,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 292,
"end": 310,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 296,
"end": 305,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 297,
"end": 305,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 299,
"end": 305,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 306,
"end": 309,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 292,
"end": 295,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 315,
"end": 333,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 319,
"end": 328,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 320,
"end": 328,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 322,
"end": 328,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 329,
"end": 332,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 315,
"end": 318,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 316,
"end": 317,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 316,
"end": 317,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
}
}
]
}
}
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 338,
"end": 346,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "x",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}