swc/crates/swc_ecma_parser/tests/tsc/assignmentCompatWithStringIndexer.json
2022-02-04 20:17:42 +09:00

2258 lines
67 KiB
JSON

{
"type": "Script",
"span": {
"start": 55,
"end": 1034,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 55,
"end": 86,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 65,
"end": 69,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 70,
"end": 86,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 72,
"end": 84,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 72,
"end": 75,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 75,
"end": 83,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 77,
"end": 83,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 87,
"end": 134,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 97,
"end": 104,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 113,
"end": 117,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 113,
"end": 117,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 118,
"end": 134,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 120,
"end": 132,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 120,
"end": 123,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 123,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 125,
"end": 131,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 135,
"end": 186,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 145,
"end": 153,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 162,
"end": 169,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 162,
"end": 169,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 170,
"end": 186,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 172,
"end": 184,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 172,
"end": 175,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 175,
"end": 183,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 177,
"end": 183,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 194,
"end": 195,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 188,
"end": 222,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 203,
"end": 212,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 204,
"end": 212,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 213,
"end": 219,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 215,
"end": 219,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 215,
"end": 219,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 202,
"end": 220,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 228,
"end": 232,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 229,
"end": 232,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 235,
"end": 267,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 239,
"end": 267,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 240,
"end": 267,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 242,
"end": 267,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 245,
"end": 254,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 246,
"end": 254,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 248,
"end": 254,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 255,
"end": 264,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 257,
"end": 264,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 257,
"end": 264,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 244,
"end": 265,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 268,
"end": 274,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 268,
"end": 273,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 281,
"end": 287,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 281,
"end": 286,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 298,
"end": 332,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 302,
"end": 332,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 302,
"end": 304,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 304,
"end": 332,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 306,
"end": 332,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 309,
"end": 318,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 310,
"end": 318,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 312,
"end": 318,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 319,
"end": 329,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 321,
"end": 329,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 321,
"end": 329,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 308,
"end": 330,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 333,
"end": 340,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 333,
"end": 339,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 333,
"end": 334,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 337,
"end": 339,
"ctxt": 0
},
"value": "b2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 347,
"end": 354,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 347,
"end": 353,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 347,
"end": 349,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 352,
"end": 353,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 365,
"end": 1034,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 372,
"end": 380,
"ctxt": 0
},
"value": "Generics",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 381,
"end": 1034,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 393,
"end": 394,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 387,
"end": 442,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 422,
"end": 431,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 423,
"end": 431,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 425,
"end": 431,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 432,
"end": 435,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 421,
"end": 436,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 394,
"end": 410,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 395,
"end": 409,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 395,
"end": 396,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 405,
"end": 409,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 405,
"end": 409,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 454,
"end": 455,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 448,
"end": 515,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 483,
"end": 492,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 484,
"end": 492,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 486,
"end": 492,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 493,
"end": 502,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 495,
"end": 502,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 495,
"end": 502,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 482,
"end": 503,
"ctxt": 0
}
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 464,
"end": 465,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 465,
"end": 471,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 466,
"end": 470,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 466,
"end": 470,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 521,
"end": 555,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 525,
"end": 554,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 525,
"end": 527,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 527,
"end": 554,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 529,
"end": 554,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 532,
"end": 541,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 533,
"end": 541,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 535,
"end": 541,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 542,
"end": 551,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 544,
"end": 551,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 544,
"end": 551,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 531,
"end": 552,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 560,
"end": 576,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 564,
"end": 575,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 564,
"end": 566,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 566,
"end": 575,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 568,
"end": 575,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 568,
"end": 569,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 569,
"end": 575,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 570,
"end": 574,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 570,
"end": 574,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 581,
"end": 589,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 581,
"end": 588,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 581,
"end": 583,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 586,
"end": 588,
"ctxt": 0
},
"value": "b1",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 600,
"end": 608,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 600,
"end": 607,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 600,
"end": 602,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 605,
"end": 607,
"ctxt": 0
},
"value": "a1",
"optional": false
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 629,
"end": 631,
"ctxt": 0
},
"value": "B2",
"optional": false
},
"declare": false,
"span": {
"start": 623,
"end": 692,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 659,
"end": 668,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 660,
"end": 668,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 662,
"end": 668,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 669,
"end": 679,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 671,
"end": 679,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 671,
"end": 679,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 658,
"end": 680,
"ctxt": 0
}
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 640,
"end": 641,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 641,
"end": 647,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 642,
"end": 646,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 642,
"end": 646,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 698,
"end": 733,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 702,
"end": 732,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 702,
"end": 704,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 704,
"end": 732,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 706,
"end": 732,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 709,
"end": 718,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 710,
"end": 718,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 712,
"end": 718,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 719,
"end": 729,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 721,
"end": 729,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 721,
"end": 729,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 708,
"end": 730,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 738,
"end": 746,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 738,
"end": 745,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 738,
"end": 740,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 743,
"end": 745,
"ctxt": 0
},
"value": "b2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 757,
"end": 765,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 757,
"end": 764,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 757,
"end": 759,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 762,
"end": 764,
"ctxt": 0
},
"value": "a1",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 789,
"end": 792,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 780,
"end": 1032,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 811,
"end": 1032,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 821,
"end": 855,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 825,
"end": 854,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 825,
"end": 827,
"ctxt": 0
},
"value": "b3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 827,
"end": 854,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 829,
"end": 854,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 832,
"end": 841,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 833,
"end": 841,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 835,
"end": 841,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 842,
"end": 851,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 844,
"end": 851,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 844,
"end": 851,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 831,
"end": 852,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 864,
"end": 877,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 868,
"end": 876,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 868,
"end": 870,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 870,
"end": 876,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 872,
"end": 876,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 872,
"end": 873,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 873,
"end": 876,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 874,
"end": 875,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 874,
"end": 875,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 886,
"end": 894,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 886,
"end": 893,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 886,
"end": 888,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 891,
"end": 893,
"ctxt": 0
},
"value": "b3",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 912,
"end": 920,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 912,
"end": 919,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 912,
"end": 914,
"ctxt": 0
},
"value": "b3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 917,
"end": 919,
"ctxt": 0
},
"value": "a3",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 939,
"end": 974,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 943,
"end": 973,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 943,
"end": 945,
"ctxt": 0
},
"value": "b4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 945,
"end": 973,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 947,
"end": 973,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 950,
"end": 959,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 951,
"end": 959,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 953,
"end": 959,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 960,
"end": 970,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 962,
"end": 970,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 962,
"end": 970,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 949,
"end": 971,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 983,
"end": 991,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 983,
"end": 990,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 983,
"end": 985,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 988,
"end": 990,
"ctxt": 0
},
"value": "b4",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1009,
"end": 1017,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1009,
"end": 1016,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1009,
"end": 1011,
"ctxt": 0
},
"value": "b4",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 1014,
"end": 1016,
"ctxt": 0
},
"value": "a3",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 792,
"end": 808,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 793,
"end": 807,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 793,
"end": 794,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 803,
"end": 807,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 803,
"end": 807,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"returnType": null
}
]
}
}
],
"interpreter": null
}