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

2258 lines
67 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 57,
"end": 1086,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 57,
"end": 88,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 67,
"end": 71,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 72,
"end": 88,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 74,
"end": 86,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 74,
"end": 77,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 77,
"end": 85,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 79,
"end": 85,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 90,
"end": 137,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 100,
"end": 107,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 116,
"end": 120,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 116,
"end": 120,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 121,
"end": 137,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 123,
"end": 135,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 123,
"end": 126,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 126,
"end": 134,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 128,
"end": 134,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 139,
"end": 190,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 149,
"end": 157,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 166,
"end": 173,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 166,
"end": 173,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 174,
"end": 190,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 176,
"end": 188,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 179,
"end": 187,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 181,
"end": 187,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 194,
"end": 230,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 210,
"end": 219,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 211,
"end": 219,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 213,
"end": 219,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 220,
"end": 226,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 222,
"end": 226,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 222,
"end": 226,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 209,
"end": 227,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 234,
"end": 243,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 238,
"end": 242,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 238,
"end": 239,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 239,
"end": 242,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 247,
"end": 279,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 251,
"end": 279,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 252,
"end": 279,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 254,
"end": 279,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 257,
"end": 266,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 258,
"end": 266,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 260,
"end": 266,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 267,
"end": 276,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 269,
"end": 276,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 269,
"end": 276,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 256,
"end": 277,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": 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": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 295,
"end": 301,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 295,
"end": 300,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 299,
"end": 300,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 314,
"end": 348,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 318,
"end": 348,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 318,
"end": 320,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 320,
"end": 348,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 322,
"end": 348,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 325,
"end": 334,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 326,
"end": 334,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 328,
"end": 334,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 335,
"end": 345,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 337,
"end": 345,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 337,
"end": 345,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 324,
"end": 346,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 350,
"end": 357,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 350,
"end": 356,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 354,
"end": 356,
"ctxt": 0
},
"value": "b2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 365,
"end": 372,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 365,
"end": 371,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 365,
"end": 367,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 370,
"end": 371,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 385,
"end": 1086,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 392,
"end": 400,
"ctxt": 0
},
"value": "Generics",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 401,
"end": 1086,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 414,
"end": 415,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 408,
"end": 465,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 444,
"end": 453,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 445,
"end": 453,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 447,
"end": 453,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 454,
"end": 457,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 456,
"end": 457,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 456,
"end": 457,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 443,
"end": 458,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 415,
"end": 431,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 416,
"end": 430,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 416,
"end": 417,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 426,
"end": 430,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 426,
"end": 430,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 479,
"end": 480,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 473,
"end": 542,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 509,
"end": 518,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 510,
"end": 518,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 512,
"end": 518,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 519,
"end": 528,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 521,
"end": 528,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 521,
"end": 528,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 508,
"end": 529,
"ctxt": 0
}
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 490,
"end": 496,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 491,
"end": 495,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 491,
"end": 495,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 550,
"end": 584,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 554,
"end": 583,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 554,
"end": 556,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 556,
"end": 583,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 558,
"end": 583,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 561,
"end": 570,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 562,
"end": 570,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 564,
"end": 570,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 571,
"end": 580,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 573,
"end": 580,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 573,
"end": 580,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 560,
"end": 581,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 590,
"end": 606,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 594,
"end": 605,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 594,
"end": 596,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 596,
"end": 605,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 598,
"end": 605,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 598,
"end": 599,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 599,
"end": 605,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 600,
"end": 604,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 600,
"end": 604,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 612,
"end": 620,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 612,
"end": 619,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 612,
"end": 614,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 617,
"end": 619,
"ctxt": 0
},
"value": "b1",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 632,
"end": 640,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 632,
"end": 639,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 632,
"end": 634,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 637,
"end": 639,
"ctxt": 0
},
"value": "a1",
"optional": false
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 663,
"end": 665,
"ctxt": 0
},
"value": "B2",
"optional": false
},
"declare": false,
"span": {
"start": 657,
"end": 728,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 694,
"end": 703,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 695,
"end": 703,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 697,
"end": 703,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 704,
"end": 714,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 706,
"end": 714,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 706,
"end": 714,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 693,
"end": 715,
"ctxt": 0
}
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 674,
"end": 675,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 675,
"end": 681,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 676,
"end": 680,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 676,
"end": 680,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 736,
"end": 771,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 740,
"end": 770,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 740,
"end": 742,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 742,
"end": 770,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 744,
"end": 770,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 747,
"end": 756,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 748,
"end": 756,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 750,
"end": 756,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 757,
"end": 767,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 759,
"end": 767,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 759,
"end": 767,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 746,
"end": 768,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 777,
"end": 785,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 777,
"end": 784,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 777,
"end": 779,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 782,
"end": 784,
"ctxt": 0
},
"value": "b2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 797,
"end": 805,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 797,
"end": 804,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 797,
"end": 799,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 802,
"end": 804,
"ctxt": 0
},
"value": "a1",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 831,
"end": 834,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 822,
"end": 1083,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 853,
"end": 1083,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 864,
"end": 898,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 868,
"end": 897,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 868,
"end": 870,
"ctxt": 0
},
"value": "b3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 870,
"end": 897,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 872,
"end": 897,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 875,
"end": 884,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 876,
"end": 884,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 878,
"end": 884,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 885,
"end": 894,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 887,
"end": 894,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 887,
"end": 894,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 874,
"end": 895,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 908,
"end": 921,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 912,
"end": 920,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 912,
"end": 914,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 914,
"end": 920,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 916,
"end": 920,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 916,
"end": 917,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 917,
"end": 920,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 918,
"end": 919,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 918,
"end": 919,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 931,
"end": 939,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 931,
"end": 938,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 931,
"end": 933,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 936,
"end": 938,
"ctxt": 0
},
"value": "b3",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 958,
"end": 966,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 958,
"end": 965,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 958,
"end": 960,
"ctxt": 0
},
"value": "b3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 963,
"end": 965,
"ctxt": 0
},
"value": "a3",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 987,
"end": 1022,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 991,
"end": 1021,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 991,
"end": 993,
"ctxt": 0
},
"value": "b4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 993,
"end": 1021,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 995,
"end": 1021,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 998,
"end": 1007,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 999,
"end": 1007,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1001,
"end": 1007,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1008,
"end": 1018,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1010,
"end": 1018,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1010,
"end": 1018,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 997,
"end": 1019,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1032,
"end": 1040,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1032,
"end": 1039,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1032,
"end": 1034,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 1037,
"end": 1039,
"ctxt": 0
},
"value": "b4",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1059,
"end": 1067,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1059,
"end": 1066,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1059,
"end": 1061,
"ctxt": 0
},
"value": "b4",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 1064,
"end": 1066,
"ctxt": 0
},
"value": "a3",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 834,
"end": 850,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 835,
"end": 849,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 835,
"end": 836,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 845,
"end": 849,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 845,
"end": 849,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"returnType": null
}
]
}
}
],
"interpreter": null
}