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

1083 lines
29 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 559,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1,
"end": 95,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 11,
"end": 15,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 16,
"end": 95,
"ctxt": 0
},
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 23,
"end": 32,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 24,
"end": 32,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 26,
"end": 32,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 33,
"end": 60,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 35,
"end": 60,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 37,
"end": 47,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 38,
"end": 46,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 48,
"end": 58,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 49,
"end": 57,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 51,
"end": 57,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"readonly": false,
"static": false,
"span": {
"start": 22,
"end": 61,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 67,
"end": 76,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 68,
"end": 76,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 70,
"end": 76,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 77,
"end": 93,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 79,
"end": 93,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 81,
"end": 91,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 82,
"end": 90,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 84,
"end": 90,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"readonly": false,
"static": false,
"span": {
"start": 66,
"end": 93,
"ctxt": 0
}
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 97,
"end": 161,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 107,
"end": 114,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 123,
"end": 127,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 123,
"end": 127,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 128,
"end": 161,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 134,
"end": 150,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 135,
"end": 150,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 137,
"end": 150,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 139,
"end": 148,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 140,
"end": 148,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 142,
"end": 148,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 163,
"end": 230,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 173,
"end": 181,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 190,
"end": 194,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 190,
"end": 194,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 195,
"end": 230,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 201,
"end": 219,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 201,
"end": 204,
"ctxt": 0
},
"value": "1",
"raw": "'1'"
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 204,
"end": 219,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 206,
"end": 219,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 208,
"end": 217,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 209,
"end": 217,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 211,
"end": 217,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 232,
"end": 299,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 242,
"end": 250,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 259,
"end": 263,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 259,
"end": 263,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 264,
"end": 299,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 270,
"end": 288,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 270,
"end": 273,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 273,
"end": 288,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 275,
"end": 288,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 277,
"end": 286,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 278,
"end": 286,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 280,
"end": 286,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 301,
"end": 370,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 311,
"end": 319,
"ctxt": 0
},
"value": "Derived4",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 328,
"end": 332,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 328,
"end": 332,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 333,
"end": 370,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 339,
"end": 359,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 339,
"end": 342,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 344,
"end": 359,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 346,
"end": 359,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 348,
"end": 357,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 348,
"end": 349,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 349,
"end": 357,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 351,
"end": 357,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 425,
"end": 490,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 435,
"end": 443,
"ctxt": 0
},
"value": "Derived5",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 452,
"end": 456,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 452,
"end": 456,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 457,
"end": 490,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 463,
"end": 479,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 463,
"end": 464,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 464,
"end": 479,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 466,
"end": 479,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 468,
"end": 477,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 468,
"end": 469,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 469,
"end": 477,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 471,
"end": 477,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 492,
"end": 559,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 502,
"end": 510,
"ctxt": 0
},
"value": "Derived5",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 519,
"end": 523,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 519,
"end": 523,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 524,
"end": 559,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 530,
"end": 548,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 530,
"end": 533,
"ctxt": 0
},
"value": "1",
"raw": "'1'"
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 533,
"end": 548,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 535,
"end": 548,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 537,
"end": 546,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 538,
"end": 546,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 540,
"end": 546,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
}
],
"interpreter": null
}