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

973 lines
26 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 100,
"end": 531,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 100,
"end": 182,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 110,
"end": 114,
"ctxt": 0
},
"value": "List",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 114,
"end": 117,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 118,
"end": 182,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 125,
"end": 133,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 125,
"end": 129,
"ctxt": 0
},
"value": "data",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 129,
"end": 132,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 139,
"end": 153,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 139,
"end": 143,
"ctxt": 0
},
"value": "next",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 143,
"end": 152,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 145,
"end": 152,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 145,
"end": 149,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 149,
"end": 152,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 159,
"end": 179,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 159,
"end": 164,
"ctxt": 0
},
"value": "owner",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 164,
"end": 178,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 166,
"end": 178,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 166,
"end": 175,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 175,
"end": 178,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 265,
"end": 333,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 275,
"end": 284,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 284,
"end": 287,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 296,
"end": 309,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 296,
"end": 300,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 300,
"end": 309,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 301,
"end": 308,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 301,
"end": 305,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 305,
"end": 308,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 310,
"end": 333,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 317,
"end": 330,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 317,
"end": 321,
"ctxt": 0
},
"value": "name",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 321,
"end": 329,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 323,
"end": 329,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 337,
"end": 360,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 341,
"end": 359,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 341,
"end": 345,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 345,
"end": 359,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 347,
"end": 359,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 347,
"end": 351,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 351,
"end": 359,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 352,
"end": 358,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 362,
"end": 395,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 366,
"end": 394,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 366,
"end": 375,
"ctxt": 0
},
"value": "ownerList",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 375,
"end": 394,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 377,
"end": 394,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 377,
"end": 386,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 386,
"end": 394,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 387,
"end": 393,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 397,
"end": 414,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 397,
"end": 413,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 397,
"end": 401,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 404,
"end": 413,
"ctxt": 0
},
"value": "ownerList",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 428,
"end": 433,
"ctxt": 0
},
"value": "other",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 437,
"end": 441,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 437,
"end": 441,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 438,
"end": 441,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 440,
"end": 441,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 440,
"end": 441,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 419,
"end": 531,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 443,
"end": 531,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 450,
"end": 468,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 454,
"end": 467,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 454,
"end": 458,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 458,
"end": 467,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 460,
"end": 467,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 460,
"end": 464,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 464,
"end": 467,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 465,
"end": 466,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 465,
"end": 466,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 474,
"end": 502,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 478,
"end": 501,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 478,
"end": 487,
"ctxt": 0
},
"value": "ownerList",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 487,
"end": 501,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 489,
"end": 501,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 489,
"end": 498,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 498,
"end": 501,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 499,
"end": 500,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 499,
"end": 500,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 508,
"end": 525,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 508,
"end": 524,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 508,
"end": 512,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 515,
"end": 524,
"ctxt": 0
},
"value": "ownerList",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
}
],
"interpreter": null
}