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
classA<T=number>{//static { type _<T extends A = A> = 0 }//^ will work when uncomment it?value!: T;child!: InstanceType<typeofA.B<A<T>>>staticB=classB<TextendsA=A>{parent!: T;}}vara=newAa.child.parent.value// ^?
π Actual behavior
Shows an error 'child' is referenced directly or indirectly in its own type annotation..
However, when uncommenting // static {...} it will work only in playground.
In VSCode it still shows the error above.
π Expected behavior
a.child.parent.value is number
Workaround
A workaround is remove the default type for class B<T>. The code below works well, also, only in playground. In my VSCode(5.0.0-dev.20230216) it still breaks unfortunately.
classA<Textendsnumber=number>{value!: T;child!: InstanceType<typeofA.B<A<T>>>staticB=classB<TextendsA>{parent!: T;}}vara=newAa.child.parent.value// ^? number
Activity
jakebailey commentedon Mar 3, 2023
I suspect #52813 is related. We'll see.