{ "type": "Program", "statements": [ { "type": "TSInterfaceDeclaration", "body": { "type": "TSInterfaceBody", "body": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 18, "column": 6 } } }, "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 14 } } }, "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 19, "column": 2 } } } ], "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 19, "column": 2 } } }, "id": { "type": "Identifier", "name": "A", "decorators": [], "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 17, "column": 12 } } }, "extends": [], "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 19, "column": 2 } } }, { "type": "TSInterfaceDeclaration", "body": { "type": "TSInterfaceBody", "body": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 22, "column": 5 }, "end": { "line": 22, "column": 6 } } }, "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 22, "column": 14 } } }, "loc": { "start": { "line": 22, "column": 5 }, "end": { "line": 22, "column": 15 } } } ], "loc": { "start": { "line": 21, "column": 23 }, "end": { "line": 23, "column": 2 } } }, "id": { "type": "Identifier", "name": "B", "decorators": [], "loc": { "start": { "line": 21, "column": 11 }, "end": { "line": 21, "column": 12 } } }, "extends": [ { "type": "TSInterfaceHeritage", "expression": { "type": "TSTypeReference", "typeName": { "type": "Identifier", "name": "A", "decorators": [], "loc": { "start": { "line": 21, "column": 21 }, "end": { "line": 21, "column": 22 } } }, "loc": { "start": { "line": 21, "column": 23 }, "end": { "line": 21, "column": 22 } } }, "loc": { "start": { "line": 21, "column": 23 }, "end": { "line": 21, "column": 22 } } } ], "loc": { "start": { "line": 21, "column": 1 }, "end": { "line": 23, "column": 2 } } }, { "type": "TSInterfaceDeclaration", "body": { "type": "TSInterfaceBody", "body": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "c", "decorators": [], "loc": { "start": { "line": 26, "column": 5 }, "end": { "line": 26, "column": 6 } } }, "typeAnnotation": { "type": "TSStringKeyword", "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 14 } } }, "loc": { "start": { "line": 26, "column": 5 }, "end": { "line": 27, "column": 2 } } } ], "loc": { "start": { "line": 25, "column": 23 }, "end": { "line": 27, "column": 2 } } }, "id": { "type": "Identifier", "name": "C", "decorators": [], "loc": { "start": { "line": 25, "column": 11 }, "end": { "line": 25, "column": 12 } } }, "extends": [ { "type": "TSInterfaceHeritage", "expression": { "type": "TSTypeReference", "typeName": { "type": "Identifier", "name": "A", "decorators": [], "loc": { "start": { "line": 25, "column": 21 }, "end": { "line": 25, "column": 22 } } }, "loc": { "start": { "line": 25, "column": 23 }, "end": { "line": 25, "column": 22 } } }, "loc": { "start": { "line": 25, "column": 23 }, "end": { "line": 25, "column": 22 } } } ], "loc": { "start": { "line": 25, "column": 1 }, "end": { "line": 27, "column": 2 } } }, { "type": "TSInterfaceDeclaration", "body": { "type": "TSInterfaceBody", "body": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "d", "decorators": [], "loc": { "start": { "line": 30, "column": 5 }, "end": { "line": 30, "column": 6 } } }, "typeAnnotation": { "type": "TSTupleType", "elementTypes": [ { "type": "TSNumberKeyword", "loc": { "start": { "line": 30, "column": 9 }, "end": { "line": 30, "column": 16 } } }, { "type": "TSNumberKeyword", "loc": { "start": { "line": 30, "column": 17 }, "end": { "line": 30, "column": 24 } } } ], "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 24 } } }, "loc": { "start": { "line": 30, "column": 5 }, "end": { "line": 30, "column": 25 } } } ], "loc": { "start": { "line": 29, "column": 26 }, "end": { "line": 31, "column": 2 } } }, "id": { "type": "Identifier", "name": "D", "decorators": [], "loc": { "start": { "line": 29, "column": 11 }, "end": { "line": 29, "column": 12 } } }, "extends": [ { "type": "TSInterfaceHeritage", "expression": { "type": "TSTypeReference", "typeName": { "type": "Identifier", "name": "B", "decorators": [], "loc": { "start": { "line": 29, "column": 21 }, "end": { "line": 29, "column": 22 } } }, "loc": { "start": { "line": 29, "column": 22 }, "end": { "line": 29, "column": 22 } } }, "loc": { "start": { "line": 29, "column": 22 }, "end": { "line": 29, "column": 22 } } }, { "type": "TSInterfaceHeritage", "expression": { "type": "TSTypeReference", "typeName": { "type": "Identifier", "name": "C", "decorators": [], "loc": { "start": { "line": 29, "column": 24 }, "end": { "line": 29, "column": 25 } } }, "loc": { "start": { "line": 29, "column": 26 }, "end": { "line": 29, "column": 25 } } }, "loc": { "start": { "line": 29, "column": 26 }, "end": { "line": 29, "column": 25 } } } ], "loc": { "start": { "line": 29, "column": 1 }, "end": { "line": 31, "column": 2 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "d", "typeAnnotation": { "type": "TSTypeReference", "typeName": { "type": "Identifier", "name": "D", "decorators": [], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 9 } } }, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 9 } } }, "decorators": [], "loc": { "start": { "line": 33, "column": 5 }, "end": { "line": 33, "column": 6 } } }, "init": null, "loc": { "start": { "line": 33, "column": 5 }, "end": { "line": 33, "column": 6 } } } ], "kind": "var", "loc": { "start": { "line": 33, "column": 1 }, "end": { "line": 33, "column": 10 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "a", "typeAnnotation": { "type": "TSTypeReference", "typeName": { "type": "Identifier", "name": "A", "decorators": [], "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 9 } } }, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 9 } } }, "decorators": [], "loc": { "start": { "line": 34, "column": 5 }, "end": { "line": 34, "column": 6 } } }, "init": null, "loc": { "start": { "line": 34, "column": 5 }, "end": { "line": 34, "column": 6 } } } ], "kind": "var", "loc": { "start": { "line": 34, "column": 1 }, "end": { "line": 34, "column": 10 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 36, "column": 1 }, "end": { "line": 36, "column": 2 } } }, "right": { "type": "Identifier", "name": "d", "decorators": [], "loc": { "start": { "line": 36, "column": 5 }, "end": { "line": 36, "column": 6 } } }, "loc": { "start": { "line": 36, "column": 1 }, "end": { "line": 36, "column": 6 } } }, "loc": { "start": { "line": 36, "column": 1 }, "end": { "line": 36, "column": 7 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "d", "decorators": [], "loc": { "start": { "line": 37, "column": 1 }, "end": { "line": 37, "column": 2 } } }, "right": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 37, "column": 5 }, "end": { "line": 37, "column": 6 } } }, "loc": { "start": { "line": 37, "column": 1 }, "end": { "line": 37, "column": 6 } } }, "loc": { "start": { "line": 37, "column": 1 }, "end": { "line": 37, "column": 7 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 38, "column": 1 } } } TypeError: Type 'A' is not assignable to type 'D'. [interfaceAssignment3.ts:37:1]