**TypeScript Version:** nightly, with `--declaration` flag, also reproducable with stable version **Code** ```ts // @declaration class A {} interface Class extends (typeof A) {} ``` **Expected behavior:** Report error like without `--declaration` flag. **Actual behavior:** Crashes with `Cannot read property 'heritageClauses' of undefined` in `writeInterfaceDeclaration`