{ "type": "Program", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "a", "typeAnnotation": { "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": 21 } } } ], "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 21 } } }, "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": 26 }, "end": { "line": 17, "column": 27 } } }, "value": { "type": "NumberLiteral", "value": 5, "loc": { "start": { "line": 17, "column": 29 }, "end": { "line": 17, "column": 30 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 30 } } }, { "type": "Property", "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 17, "column": 32 }, "end": { "line": 17, "column": 33 } } }, "value": { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 17, "column": 35 }, "end": { "line": 17, "column": 40 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 32 }, "end": { "line": 17, "column": 40 } } } ], "loc": { "start": { "line": 17, "column": 24 }, "end": { "line": 17, "column": 42 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 42 } } } ], "kind": "var", "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 43 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 17, "column": 43 } } } TypeError: Object literal may only specify known properties, and "b" does not exist in type '{ a: number; }'. [objectLiteralAssignability2.ts:17:32]