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

1459 lines
45 KiB
JSON

{
"type": "Module",
"span": {
"start": 60,
"end": 932,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 60,
"end": 377,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 67,
"end": 377,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 79,
"ctxt": 0
},
"value": "AppType",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 86,
"end": 115,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 86,
"end": 98,
"ctxt": 0
},
"value": "HeaderDetail",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 101,
"end": 115,
"ctxt": 0
},
"value": "HeaderDetail",
"raw": "'HeaderDetail'"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 121,
"end": 160,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 121,
"end": 138,
"ctxt": 0
},
"value": "HeaderMultiDetail",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 141,
"end": 160,
"ctxt": 0
},
"value": "HeaderMultiDetail",
"raw": "'HeaderMultiDetail'"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 166,
"end": 195,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 166,
"end": 178,
"ctxt": 0
},
"value": "AdvancedList",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 181,
"end": 195,
"ctxt": 0
},
"value": "AdvancedList",
"raw": "'AdvancedList'"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 201,
"end": 222,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 201,
"end": 209,
"ctxt": 0
},
"value": "Standard",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 212,
"end": 222,
"ctxt": 0
},
"value": "Standard",
"raw": "'Standard'"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 228,
"end": 257,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 228,
"end": 240,
"ctxt": 0
},
"value": "Relationship",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 243,
"end": 257,
"ctxt": 0
},
"value": "Relationship",
"raw": "'Relationship'"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 263,
"end": 280,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 263,
"end": 269,
"ctxt": 0
},
"value": "Report",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 272,
"end": 280,
"ctxt": 0
},
"value": "Report",
"raw": "'Report'"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 286,
"end": 309,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 286,
"end": 295,
"ctxt": 0
},
"value": "Composite",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 298,
"end": 309,
"ctxt": 0
},
"value": "Composite",
"raw": "'Composite'"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 315,
"end": 336,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 315,
"end": 323,
"ctxt": 0
},
"value": "ListOnly",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 326,
"end": 336,
"ctxt": 0
},
"value": "ListOnly",
"raw": "'ListOnly'"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 342,
"end": 375,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 342,
"end": 356,
"ctxt": 0
},
"value": "ModuleSettings",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 359,
"end": 375,
"ctxt": 0
},
"value": "ModuleSettings",
"raw": "'ModuleSettings'"
}
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 379,
"end": 471,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 386,
"end": 471,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 391,
"end": 399,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 406,
"end": 410,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 406,
"end": 410,
"ctxt": 0
},
"value": "Tree",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 416,
"end": 426,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 416,
"end": 426,
"ctxt": 0
},
"value": "TreeEntity",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 432,
"end": 440,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 432,
"end": 440,
"ctxt": 0
},
"value": "Standard",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 446,
"end": 453,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 446,
"end": 453,
"ctxt": 0
},
"value": "MiniApp",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 459,
"end": 469,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 459,
"end": 469,
"ctxt": 0
},
"value": "PivotTable",
"optional": false
},
"init": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 473,
"end": 762,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 479,
"end": 761,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 479,
"end": 501,
"ctxt": 0
},
"value": "appTypeStylesWithError",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 501,
"end": 532,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 503,
"end": 532,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 503,
"end": 506,
"ctxt": 0
},
"value": "Map",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 506,
"end": 532,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 507,
"end": 514,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 507,
"end": 514,
"ctxt": 0
},
"value": "AppType",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 516,
"end": 531,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 516,
"end": 521,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 521,
"end": 531,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 522,
"end": 530,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 522,
"end": 530,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
},
"init": {
"type": "NewExpression",
"span": {
"start": 535,
"end": 761,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 539,
"end": 542,
"ctxt": 0
},
"value": "Map",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 543,
"end": 760,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 549,
"end": 606,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 550,
"end": 566,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 550,
"end": 557,
"ctxt": 0
},
"value": "AppType",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 558,
"end": 566,
"ctxt": 0
},
"value": "Standard",
"optional": false
}
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 568,
"end": 605,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 569,
"end": 586,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 569,
"end": 577,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 578,
"end": 586,
"ctxt": 0
},
"value": "Standard",
"optional": false
}
}
},
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 588,
"end": 604,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 588,
"end": 596,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 597,
"end": 604,
"ctxt": 0
},
"value": "MiniApp",
"optional": false
}
}
}
]
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 612,
"end": 691,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 613,
"end": 633,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 613,
"end": 620,
"ctxt": 0
},
"value": "AppType",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 621,
"end": 633,
"ctxt": 0
},
"value": "Relationship",
"optional": false
}
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 635,
"end": 690,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 636,
"end": 653,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 636,
"end": 644,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 645,
"end": 653,
"ctxt": 0
},
"value": "Standard",
"optional": false
}
}
},
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 655,
"end": 668,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 655,
"end": 663,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 664,
"end": 668,
"ctxt": 0
},
"value": "Tree",
"optional": false
}
}
},
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 670,
"end": 689,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 670,
"end": 678,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 679,
"end": 689,
"ctxt": 0
},
"value": "TreeEntity",
"optional": false
}
}
}
]
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 697,
"end": 758,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 698,
"end": 718,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 698,
"end": 705,
"ctxt": 0
},
"value": "AppType",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 706,
"end": 718,
"ctxt": 0
},
"value": "AdvancedList",
"optional": false
}
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 720,
"end": 757,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 721,
"end": 738,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 721,
"end": 729,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 730,
"end": 738,
"ctxt": 0
},
"value": "Standard",
"optional": false
}
}
},
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 740,
"end": 756,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 740,
"end": 748,
"ctxt": 0
},
"value": "AppStyle",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 749,
"end": 756,
"ctxt": 0
},
"value": "MiniApp",
"optional": false
}
}
}
]
}
}
]
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 803,
"end": 806,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 810,
"end": 822,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 810,
"end": 822,
"ctxt": 0
},
"rest": {
"start": 810,
"end": 813,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 813,
"end": 817,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 817,
"end": 822,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 819,
"end": 822,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 819,
"end": 820,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 819,
"end": 820,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 786,
"end": 829,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 806,
"end": 809,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 807,
"end": 808,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 807,
"end": 808,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 823,
"end": 828,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 825,
"end": 828,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 825,
"end": 826,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 825,
"end": 826,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 830,
"end": 888,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 834,
"end": 887,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 834,
"end": 836,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 836,
"end": 854,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 838,
"end": 854,
"ctxt": 0
},
"elemType": {
"type": "TsTypeLiteral",
"span": {
"start": 838,
"end": 852,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 840,
"end": 850,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 840,
"end": 841,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 841,
"end": 850,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 843,
"end": 850,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 857,
"end": 887,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 857,
"end": 860,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 861,
"end": 872,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 863,
"end": 864,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 866,
"end": 870,
"ctxt": 0
},
"value": true
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 874,
"end": 886,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 876,
"end": 877,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 879,
"end": 884,
"ctxt": 0
},
"value": false
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 889,
"end": 932,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 893,
"end": 931,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 893,
"end": 895,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 895,
"end": 908,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 897,
"end": 908,
"ctxt": 0
},
"elemType": {
"type": "TsArrayType",
"span": {
"start": 897,
"end": 906,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 897,
"end": 904,
"ctxt": 0
},
"kind": "boolean"
}
}
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 911,
"end": 931,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 911,
"end": 914,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 915,
"end": 921,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 916,
"end": 920,
"ctxt": 0
},
"value": true
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 923,
"end": 930,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 924,
"end": 929,
"ctxt": 0
},
"value": false
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}