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

2690 lines
71 KiB
JSON

{
"type": "Script",
"span": {
"start": 18,
"end": 1289,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 27,
"end": 29,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 84,
"end": 92,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 84,
"end": 92,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 85,
"end": 92,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 87,
"end": 92,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 18,
"end": 188,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 94,
"end": 188,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 159,
"end": 186,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 163,
"end": 185,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 164,
"end": 181,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 166,
"end": 181,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 166,
"end": 172,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 175,
"end": 181,
"ctxt": 0
},
"kind": "number"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 184,
"end": 185,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 29,
"end": 83,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 30,
"end": 55,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsUnionType",
"span": {
"start": 40,
"end": 55,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 49,
"end": 55,
"ctxt": 0
},
"kind": "number"
}
]
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 57,
"end": 82,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": {
"type": "TsUnionType",
"span": {
"start": 67,
"end": 82,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 67,
"end": 73,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 76,
"end": 82,
"ctxt": 0
},
"kind": "number"
}
]
},
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 199,
"end": 201,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 278,
"end": 286,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 278,
"end": 286,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 279,
"end": 286,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 281,
"end": 286,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 190,
"end": 557,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 288,
"end": 557,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 294,
"end": 322,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 298,
"end": 321,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 298,
"end": 300,
"ctxt": 0
},
"value": "y1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 300,
"end": 317,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 302,
"end": 317,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 302,
"end": 308,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 311,
"end": 317,
"ctxt": 0
},
"kind": "number"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 320,
"end": 321,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 340,
"end": 366,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 344,
"end": 365,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 344,
"end": 346,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 346,
"end": 361,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 348,
"end": 361,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 348,
"end": 354,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 357,
"end": 361,
"ctxt": 0
},
"kind": "null"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 386,
"end": 417,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 390,
"end": 416,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 390,
"end": 392,
"ctxt": 0
},
"value": "y3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 392,
"end": 412,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 394,
"end": 412,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 394,
"end": 400,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 403,
"end": 412,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 422,
"end": 448,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 426,
"end": 447,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 426,
"end": 428,
"ctxt": 0
},
"value": "y4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 428,
"end": 443,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 430,
"end": 443,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 430,
"end": 436,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 439,
"end": 443,
"ctxt": 0
},
"kind": "null"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 446,
"end": 447,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 468,
"end": 499,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 472,
"end": 498,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 472,
"end": 474,
"ctxt": 0
},
"value": "y5",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 474,
"end": 494,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 476,
"end": 494,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 476,
"end": 482,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 485,
"end": 494,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 497,
"end": 498,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 514,
"end": 543,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 518,
"end": 542,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 518,
"end": 520,
"ctxt": 0
},
"value": "y6",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 520,
"end": 538,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 522,
"end": 538,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 522,
"end": 526,
"ctxt": 0
},
"kind": "null"
},
{
"type": "TsKeywordType",
"span": {
"start": 529,
"end": 538,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 541,
"end": 542,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 201,
"end": 277,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 202,
"end": 239,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsUnionType",
"span": {
"start": 212,
"end": 239,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 212,
"end": 218,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 221,
"end": 227,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 230,
"end": 239,
"ctxt": 0
},
"kind": "undefined"
}
]
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 241,
"end": 276,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": {
"type": "TsUnionType",
"span": {
"start": 251,
"end": 276,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 251,
"end": 257,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 260,
"end": 264,
"ctxt": 0
},
"kind": "null"
},
{
"type": "TsKeywordType",
"span": {
"start": 267,
"end": 276,
"ctxt": 0
},
"kind": "undefined"
}
]
},
"default": null
}
]
},
"returnType": null
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 559,
"end": 629,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 564,
"end": 566,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 569,
"end": 628,
"ctxt": 0
},
"types": [
{
"type": "TsParenthesizedType",
"span": {
"start": 569,
"end": 598,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 570,
"end": 597,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 570,
"end": 576,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 579,
"end": 585,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 588,
"end": 597,
"ctxt": 0
},
"kind": "undefined"
}
]
}
},
{
"type": "TsParenthesizedType",
"span": {
"start": 601,
"end": 628,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 602,
"end": 627,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 602,
"end": 608,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 611,
"end": 615,
"ctxt": 0
},
"kind": "null"
},
{
"type": "TsKeywordType",
"span": {
"start": 618,
"end": 627,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 663,
"end": 665,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 705,
"end": 741,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 705,
"end": 741,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 706,
"end": 741,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 708,
"end": 741,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 708,
"end": 709,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 708,
"end": 709,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsParenthesizedType",
"span": {
"start": 712,
"end": 741,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 713,
"end": 740,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 713,
"end": 719,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 722,
"end": 728,
"ctxt": 0
},
"kind": "object"
},
{
"type": "TsKeywordType",
"span": {
"start": 731,
"end": 740,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 654,
"end": 783,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 743,
"end": 783,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 749,
"end": 781,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 755,
"end": 780,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 755,
"end": 756,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 756,
"end": 776,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 758,
"end": 776,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 758,
"end": 764,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 767,
"end": 776,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 779,
"end": 780,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 665,
"end": 704,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 666,
"end": 703,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 666,
"end": 667,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsUnionType",
"span": {
"start": 676,
"end": 703,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 676,
"end": 682,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 685,
"end": 691,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 694,
"end": 703,
"ctxt": 0
},
"kind": "undefined"
}
]
},
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 794,
"end": 796,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 824,
"end": 848,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 824,
"end": 848,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 825,
"end": 848,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 827,
"end": 848,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 827,
"end": 828,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 827,
"end": 828,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsParenthesizedType",
"span": {
"start": 831,
"end": 848,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 832,
"end": 847,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 832,
"end": 838,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 841,
"end": 847,
"ctxt": 0
},
"kind": "object"
}
]
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 785,
"end": 878,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 850,
"end": 878,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 856,
"end": 876,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 862,
"end": 875,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 862,
"end": 863,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 863,
"end": 871,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 865,
"end": 871,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 874,
"end": 875,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 796,
"end": 823,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 797,
"end": 822,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 797,
"end": 798,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsUnionType",
"span": {
"start": 807,
"end": 822,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 807,
"end": 813,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 816,
"end": 822,
"ctxt": 0
},
"kind": "number"
}
]
},
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 889,
"end": 891,
"ctxt": 0
},
"value": "f5",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 914,
"end": 928,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 914,
"end": 928,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 915,
"end": 928,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 917,
"end": 928,
"ctxt": 0
},
"types": [
{
"type": "TsTypeOperator",
"span": {
"start": 917,
"end": 924,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 923,
"end": 924,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 923,
"end": 924,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTypeReference",
"span": {
"start": 927,
"end": 928,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 927,
"end": 928,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 880,
"end": 959,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 930,
"end": 959,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 936,
"end": 957,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 940,
"end": 956,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 940,
"end": 941,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 941,
"end": 952,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 943,
"end": 952,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 949,
"end": 952,
"ctxt": 0
},
"kind": "any"
}
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 955,
"end": 956,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 891,
"end": 913,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 892,
"end": 893,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 892,
"end": 893,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 895,
"end": 912,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 895,
"end": 896,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": {
"type": "TsTypeOperator",
"span": {
"start": 905,
"end": 912,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 911,
"end": 912,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 911,
"end": 912,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"default": null
}
]
},
"returnType": null
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 983,
"end": 1079,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 988,
"end": 995,
"ctxt": 0
},
"value": "Example",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 995,
"end": 1001,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 996,
"end": 997,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 996,
"end": 997,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 999,
"end": 1000,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 999,
"end": 1000,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsMappedType",
"span": {
"start": 1004,
"end": 1079,
"ctxt": 0
},
"readonly": null,
"typeParam": {
"type": "TsTypeParameter",
"span": {
"start": 1007,
"end": 1019,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1007,
"end": 1008,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": {
"type": "TsTypeOperator",
"span": {
"start": 1012,
"end": 1019,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1018,
"end": 1019,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1018,
"end": 1019,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"default": null
},
"nameType": null,
"optional": null,
"typeAnnotation": {
"type": "TsConditionalType",
"span": {
"start": 1022,
"end": 1077,
"ctxt": 0
},
"checkType": {
"type": "TsTypeReference",
"span": {
"start": 1022,
"end": 1023,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1022,
"end": 1023,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
},
"extendsType": {
"type": "TsTypeOperator",
"span": {
"start": 1032,
"end": 1039,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1038,
"end": 1039,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1038,
"end": 1039,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
},
"trueType": {
"type": "TsTypeReference",
"span": {
"start": 1042,
"end": 1060,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1042,
"end": 1057,
"ctxt": 0
},
"value": "UnexpectedError",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1057,
"end": 1060,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1058,
"end": 1059,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1058,
"end": 1059,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
]
}
},
"falseType": {
"type": "TsTypeReference",
"span": {
"start": 1063,
"end": 1077,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1063,
"end": 1074,
"ctxt": 0
},
"value": "NoErrorHere",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1074,
"end": 1077,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1075,
"end": 1076,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1075,
"end": 1076,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1081,
"end": 1128,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1086,
"end": 1101,
"ctxt": 0
},
"value": "UnexpectedError",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1101,
"end": 1124,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1102,
"end": 1123,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1102,
"end": 1103,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 1112,
"end": 1123,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1112,
"end": 1123,
"ctxt": 0
},
"value": "PropertyKey",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1127,
"end": 1128,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1127,
"end": 1128,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1129,
"end": 1172,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1134,
"end": 1145,
"ctxt": 0
},
"value": "NoErrorHere",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1145,
"end": 1168,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1146,
"end": 1167,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1146,
"end": 1147,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 1156,
"end": 1167,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1156,
"end": 1167,
"ctxt": 0
},
"value": "PropertyKey",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1171,
"end": 1172,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1171,
"end": 1172,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1196,
"end": 1245,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1201,
"end": 1202,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1202,
"end": 1205,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1203,
"end": 1204,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1203,
"end": 1204,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsConditionalType",
"span": {
"start": 1208,
"end": 1244,
"ctxt": 0
},
"checkType": {
"type": "TsTypeReference",
"span": {
"start": 1208,
"end": 1209,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1208,
"end": 1209,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
"extendsType": {
"type": "TsTypeReference",
"span": {
"start": 1218,
"end": 1232,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1218,
"end": 1223,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1223,
"end": 1232,
"ctxt": 0
},
"params": [
{
"type": "TsInferType",
"span": {
"start": 1224,
"end": 1231,
"ctxt": 0
},
"typeParam": {
"type": "TsTypeParameter",
"span": {
"start": 1230,
"end": 1231,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1230,
"end": 1231,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
}
]
}
},
"trueType": {
"type": "TsTypeReference",
"span": {
"start": 1235,
"end": 1236,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1235,
"end": 1236,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
"falseType": {
"type": "TsKeywordType",
"span": {
"start": 1239,
"end": 1244,
"ctxt": 0
},
"kind": "never"
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1246,
"end": 1289,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1251,
"end": 1252,
"ctxt": 0
},
"value": "b",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1252,
"end": 1255,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1253,
"end": 1254,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1253,
"end": 1254,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsMappedType",
"span": {
"start": 1258,
"end": 1288,
"ctxt": 0
},
"readonly": null,
"typeParam": {
"type": "TsTypeParameter",
"span": {
"start": 1261,
"end": 1280,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1261,
"end": 1262,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": {
"type": "TsIntersectionType",
"span": {
"start": 1266,
"end": 1280,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 1266,
"end": 1270,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1266,
"end": 1267,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1267,
"end": 1270,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1268,
"end": 1269,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1268,
"end": 1269,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeOperator",
"span": {
"start": 1273,
"end": 1280,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1279,
"end": 1280,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1279,
"end": 1280,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
]
},
"default": null
},
"nameType": null,
"optional": null,
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 1284,
"end": 1286,
"ctxt": 0
},
"literal": {
"type": "NumericLiteral",
"span": {
"start": 1284,
"end": 1286,
"ctxt": 0
},
"value": 42.0
}
}
}
}
],
"interpreter": null
}