{ "type": "Program", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "a", "typeAnnotation": { "type": "TSUnionType", "types": [ { "type": "TSTypeLiteral", "members": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 10 }, "end": { "line": 17, "column": 11 } } }, "typeAnnotation": { "type": "TSTypeLiteral", "members": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 15 }, "end": { "line": 17, "column": 16 } } }, "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 18 }, "end": { "line": 17, "column": 24 } } }, "loc": { "start": { "line": 17, "column": 15 }, "end": { "line": 17, "column": 25 } } }, { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 27 } } }, "typeAnnotation": { "type": "TSArrayType", "elementType": { "type": "TSStringKeyword", "loc": { "start": { "line": 17, "column": 29 }, "end": { "line": 17, "column": 35 } } }, "loc": { "start": { "line": 17, "column": 29 }, "end": { "line": 17, "column": 37 } } }, "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 39 } } } ], "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 39 } } }, "loc": { "start": { "line": 17, "column": 10 }, "end": { "line": 17, "column": 41 } } } ], "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 41 } } }, { "type": "TSTypeLiteral", "members": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 46 }, "end": { "line": 17, "column": 47 } } }, "typeAnnotation": { "type": "TSTypeLiteral", "members": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 51 }, "end": { "line": 17, "column": 52 } } }, "typeAnnotation": { "type": "TSArrayType", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 54 }, "end": { "line": 17, "column": 60 } } }, "loc": { "start": { "line": 17, "column": 54 }, "end": { "line": 17, "column": 62 } } }, "loc": { "start": { "line": 17, "column": 51 }, "end": { "line": 17, "column": 63 } } }, { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 17, "column": 64 }, "end": { "line": 17, "column": 65 } } }, "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 67 }, "end": { "line": 17, "column": 73 } } }, "loc": { "start": { "line": 17, "column": 64 }, "end": { "line": 17, "column": 75 } } } ], "loc": { "start": { "line": 17, "column": 49 }, "end": { "line": 17, "column": 75 } } }, "loc": { "start": { "line": 17, "column": 46 }, "end": { "line": 17, "column": 77 } } } ], "loc": { "start": { "line": 17, "column": 44 }, "end": { "line": 17, "column": 77 } } } ], "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 77 } } }, "decorators": [], "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 6 } } }, "init": { "type": "ObjectExpression", "properties": [ { "type": "Property", "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 82 }, "end": { "line": 17, "column": 83 } } }, "value": { "type": "NumberLiteral", "value": 5, "loc": { "start": { "line": 17, "column": 85 }, "end": { "line": 17, "column": 86 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 82 }, "end": { "line": 17, "column": 86 } } } ], "loc": { "start": { "line": 17, "column": 80 }, "end": { "line": 17, "column": 88 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 88 } } } ], "kind": "var", "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 88 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 17, "column": 88 } } } TypeError: Type 'number' is not assignable to type '{ a: number; b: string[]; } | { a: number[]; b: number; }'. [objectLiteralAssignability11.ts:17:82]