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
In case a type T has a field also of type T (circular reference), TypeScripts meta type language features cause issues:
Example of problematic TypeScript type
exportinterfaceClash{someMethod():void;fieldWithError: ExcludeMethods<Clash>[];// 2 errors here, second is of interest// Error 0: 'fieldWithError' is referenced directly or indirectly in its own type annotation.// Error 1: Type of property 'fieldWithError' circularly references itself in mapped type '{ [K in keyof Clash]: Clash[K] extends Function ? never : K; }'}typeExcludeMethods<T>=Pick<T,{[KinkeyofT]: T[K]extendsFunction ? never : K}[keyofT]>;
Since we use this definition when transpiling from n4js to d.ts, there can be errors in the resulting d.ts output. This needs to be addressed.
The text was updated successfully, but these errors were encountered:
…e structures (#2578)
* add test
* improve test
* fix
* improve test
* use newer version of TypeScript
* fix
* improve test
* fix
* improve tests
* fix
* more fixes
In case a type T has a field also of type T (circular reference), TypeScripts meta type language features cause issues:
Example of problematic TypeScript type
Since we use this definition when transpiling from n4js to d.ts, there can be errors in the resulting d.ts output. This needs to be addressed.
The text was updated successfully, but these errors were encountered: