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
Type 'C' recursively references itself as a base type.ts(2310)
'C' is referenced directly or indirectly in its own base expression.ts(2506)
where as there's no such error with TS 4.2.4
If the p function parameter is changed from fn: () => T to fn: () => any or x: p<C[]>(() => []) is changed to x: p<C[]>(() => [] as any) then it does not give that error anymore.
Real impact:
This impacts a library that used to be able to do self-referenced models:
Bug Report
Given (this is just the smaller repro I could come up with, not real code):
With TS 4.3.2 it gives the errors:
where as there's no such error with TS 4.2.4
If the p function parameter is changed from
fn: () => Ttofn: () => anyorx: p<C[]>(() => [])is changed tox: p<C[]>(() => [] as any)then it does not give that error anymore.Real impact:
This impacts a library that used to be able to do self-referenced models:
but with the new version it is not possible anymore
Alternative repro:
🕗 Version & Regression Information
⏯ Playground Link
Playground Link