You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property 'heritageClauses' of undefined
at Object.getClassExtendsHeritageClauseElement (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:6149:52)
at getBaseTypeNodeOfClass (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:17884:23)
at getBaseConstructorTypeOfClass (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:17905:36)
at resolveBaseTypesOfClass (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:17948:39)
at Object.writeBaseConstructorTypeOfClass (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:30259:13)
at emitTypeOfTypeReference (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:32596:30)
at emitSeparatedList (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:31999:21)
at emitCommaList (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:32004:13)
at emitHeritageClause (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:32585:17)
at writeInterfaceDeclaration (/Users/misko/work/angular/node_modules/typescript/lib/typescript.js:32662:13)
Compilation failed
The text was updated successfully, but these errors were encountered:
I tested this code with the typescript version you gave (1.9.0-dev.20160409) .
I used two files, type.ts and a.ts, with the contents you provided, and an empty tsconfig.json.
I just get the errors:
If I change the code in a.ts to end in interface TypeProvider extends Type<any> {}, it compiles with no errors.
As you said, it was working for you on the playground, so there must be something unique to your configuration. Can you reproduce the error in a sample project, and provide the tsconfig.json that you used to reproduce it?
I can tell that you are emitting declaration files, because that's where the error happens, but running tsc --declaration still won't reproduce the error.
TypeScript Version: 1.8.0 / nightly (2.0.0-dev.201xxxxx)
Version 1.9.0-dev.20160409
Code
type.ts
:It provides a correct error here:
https://www.typescriptlang.org/play/#src=export%20var%20Type%20%3D%20Function%3B%0D%0A%0D%0Aexport%20interface%20Type%3CT%3E%20extends%20Function%20%7B%20new%20(...args%3A%20any%5B%5D)%3A%20T%3B%20%7D%0D%0A%0D%0Ainterface%20TypeProvider%20extends%20Type%3Cany%3E%0D%0A%3B%0D%0A
Expected behavior:
a reasonable error
Actual behavior:
The text was updated successfully, but these errors were encountered: