{ "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": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 19 } } }, "loc": { "start": { "line": 17, "column": 10 }, "end": { "line": 17, "column": 20 } } }, { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 22 } } }, "typeAnnotation": { "type": "TSStringKeyword", "loc": { "start": { "line": 17, "column": 24 }, "end": { "line": 17, "column": 30 } } }, "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 32 } } } ], "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 32 } } }, { "type": "TSTypeLiteral", "members": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 37 }, "end": { "line": 17, "column": 38 } } }, "typeAnnotation": { "type": "TSStringKeyword", "loc": { "start": { "line": 17, "column": 40 }, "end": { "line": 17, "column": 46 } } }, "loc": { "start": { "line": 17, "column": 37 }, "end": { "line": 17, "column": 47 } } }, { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 17, "column": 48 }, "end": { "line": 17, "column": 49 } } }, "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 51 }, "end": { "line": 17, "column": 57 } } }, "loc": { "start": { "line": 17, "column": 48 }, "end": { "line": 17, "column": 59 } } } ], "loc": { "start": { "line": 17, "column": 35 }, "end": { "line": 17, "column": 59 } } } ], "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 59 } } }, "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": 64 }, "end": { "line": 17, "column": 65 } } }, "value": { "type": "BooleanLiteral", "value": true, "loc": { "start": { "line": 17, "column": 67 }, "end": { "line": 17, "column": 71 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 64 }, "end": { "line": 17, "column": 71 } } } ], "loc": { "start": { "line": 17, "column": 62 }, "end": { "line": 17, "column": 73 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 73 } } } ], "kind": "var", "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 74 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 17, "column": 74 } } } TypeError: Type 'boolean' is not assignable to type 'number | string'. [objectLiteralAssignability6.ts:17:64]