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>{value!: T;child!: typeofA.B<A<T>>;// errorschild2!: typeofA.B<A<T>>;// same as above but doesn't errorstaticB=classB<TextendsA=A>{parent!: T;};}classA2<T=number>{value!: T;child!: typeofA2.B<A2<number>>;child2!: typeofA2.B<A2<T>>;// same as A.child (and A.child2) but doesn't errorstaticB=classB<TextendsA2=A2>{parent!: T;};}
π Actual behavior
child2 in both classes is free of errors
π Expected behavior
both child2 properties should contain errors (like child in A)
Additional information about the issue
This is related to the fact that child2 reenters getVariancesWorker for the same symbol, so it returns with emptyArray that was eagerly set as links.variances on the first entry of this function. This, in turn, is a signal for structuredTypeRelatedToWorker to return Ternary.Unknown.
Since this is truly a circular situation, I think this is effectively a design limitation. I'm only reporting this for documentation purposes.
The text was updated successfully, but these errors were encountered:
π Search Terms
variance class expression instantiation reference
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.6.0-dev.20240812#code/MYGwhgzhAECCA8AVaBeaA7ArgWwEYFMAnAPmgG8AoaaANzBE3wEIAuaRAbiumAAsBLEABNW0AC4BPAA74A9gDM4AOgBC8BImLEO0APS7oRQrMIRufQUIBMoyTIXK1GrTv3QIYbPmiQfuWTTeuJhi0EKy+BDoAOShRiYU3BBiYGL8wNAqqDzgUJlIhgAeYvjoQjCw2bCklNTUUmCEpWKinNwAvlztiaCQFVYFaFh4RDXcdAzMbG3UFsK20nKKsFaq6gPDBCTa5gLCNmx2S3CrTgOa2noGHl4+FUpzQtAAFGBlyo9WAJTQwaHhkRicUIxkIiWoyVS6Uy2V6eTUyHwxVK5ROVSsYzq0AaTXQLWmXGonQo3SAA
π» Code
π Actual behavior
child2
in both classes is free of errorsπ Expected behavior
both
child2
properties should contain errors (likechild
inA
)Additional information about the issue
This is related to the fact that
child2
reentersgetVariancesWorker
for the same symbol, so it returns withemptyArray
that was eagerly set aslinks.variances
on the first entry of this function. This, in turn, is a signal forstructuredTypeRelatedToWorker
to returnTernary.Unknown
.Since this is truly a circular situation, I think this is effectively a design limitation. I'm only reporting this for documentation purposes.
The text was updated successfully, but these errors were encountered: