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

1074 lines
38 KiB
JSON

{
"type": "Script",
"span": {
"start": 114,
"end": 291,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 114,
"end": 172,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 124,
"end": 125,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 125,
"end": 131,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "S",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 132,
"end": 172,
"ctxt": 0
},
"body": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 138,
"end": 170,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 142,
"end": 166,
"ctxt": 0
},
"value": "f",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 143,
"end": 166,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 145,
"end": 166,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 146,
"end": 150,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 166,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 155,
"end": 166,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 156,
"end": 160,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 157,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 162,
"end": 166,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
}
}
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 138,
"end": 141,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 174,
"end": 214,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 178,
"end": 214,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 179,
"end": 214,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 181,
"end": 214,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 185,
"end": 189,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 186,
"end": 189,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 191,
"end": 214,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 194,
"end": 214,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 198,
"end": 202,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 199,
"end": 202,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 194,
"end": 197,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 195,
"end": 196,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 195,
"end": 196,
"ctxt": 0
},
"value": "S",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 204,
"end": 214,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 207,
"end": 214,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 215,
"end": 284,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 219,
"end": 284,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 219,
"end": 220,
"ctxt": 0
},
"value": "h",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 220,
"end": 284,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 222,
"end": 284,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 226,
"end": 230,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 227,
"end": 230,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 222,
"end": 225,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 232,
"end": 284,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 235,
"end": 284,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 239,
"end": 243,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 240,
"end": 243,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 235,
"end": 238,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": "S",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 245,
"end": 284,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 248,
"end": 284,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 250,
"end": 282,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 254,
"end": 278,
"ctxt": 0
},
"value": "f",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 255,
"end": 278,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 257,
"end": 278,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 258,
"end": 262,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 259,
"end": 262,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 264,
"end": 278,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 267,
"end": 278,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 268,
"end": 272,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 269,
"end": 272,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 274,
"end": 278,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
}
}
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 279,
"end": 282,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 250,
"end": 253,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
}
}
]
}
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 286,
"end": 291,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 286,
"end": 291,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 290,
"end": 291,
"ctxt": 0
},
"value": "h",
"optional": false
}
}
}
],
"interpreter": null
}