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

973 lines
26 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 98,
"end": 509,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 98,
"end": 176,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 108,
"end": 112,
"ctxt": 0
},
"value": "List",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 112,
"end": 115,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 116,
"end": 176,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 122,
"end": 130,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 122,
"end": 126,
"ctxt": 0
},
"value": "data",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 126,
"end": 129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 135,
"end": 149,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 135,
"end": 139,
"ctxt": 0
},
"value": "next",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 139,
"end": 148,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 141,
"end": 148,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 141,
"end": 145,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 145,
"end": 148,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 154,
"end": 174,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 154,
"end": 159,
"ctxt": 0
},
"value": "owner",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 159,
"end": 173,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 161,
"end": 173,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 161,
"end": 170,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 170,
"end": 173,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 256,
"end": 322,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 266,
"end": 275,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 275,
"end": 278,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 287,
"end": 300,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 287,
"end": 291,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 291,
"end": 300,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 292,
"end": 299,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 292,
"end": 296,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 296,
"end": 299,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 301,
"end": 322,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 307,
"end": 320,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 307,
"end": 311,
"ctxt": 0
},
"value": "name",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 311,
"end": 319,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 313,
"end": 319,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 324,
"end": 347,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 328,
"end": 346,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 328,
"end": 332,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 332,
"end": 346,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 334,
"end": 346,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 334,
"end": 338,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 338,
"end": 346,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 339,
"end": 345,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 348,
"end": 381,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 352,
"end": 380,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 352,
"end": 361,
"ctxt": 0
},
"value": "ownerList",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 361,
"end": 380,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 363,
"end": 380,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 363,
"end": 372,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 372,
"end": 380,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 373,
"end": 379,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 382,
"end": 399,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 382,
"end": 398,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 382,
"end": 386,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 389,
"end": 398,
"ctxt": 0
},
"value": "ownerList",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 411,
"end": 416,
"ctxt": 0
},
"value": "other",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 420,
"end": 424,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 420,
"end": 424,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 421,
"end": 424,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 402,
"end": 509,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 426,
"end": 509,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 432,
"end": 450,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 436,
"end": 449,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 436,
"end": 440,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 440,
"end": 449,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 442,
"end": 449,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 442,
"end": 446,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 446,
"end": 449,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 455,
"end": 483,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 459,
"end": 482,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 459,
"end": 468,
"ctxt": 0
},
"value": "ownerList",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 468,
"end": 482,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 470,
"end": 482,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 470,
"end": 479,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 479,
"end": 482,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 480,
"end": 481,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 480,
"end": 481,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 488,
"end": 505,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 488,
"end": 504,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 488,
"end": 492,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 495,
"end": 504,
"ctxt": 0
},
"value": "ownerList",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 416,
"end": 419,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 417,
"end": 418,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 417,
"end": 418,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
}
],
"interpreter": null
}