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
leta : {prop: string}|undefined=undefined;for(letx=0;x<2;x++){constdep=a===undefined ? "a" : "b";a={prop: dep}}
π Actual behavior
'dep' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
If not inside any type of cycle (e.g. while (true)), dep is correctly typed as "a" | "b" (see the playground link). So the actual value of a has not been used in the type information. Even if it has been the case, the cycle should break because a.prop is strongly defined and is not dependant in any case on the a = {prop: dep} assignment
π Expected behavior
dep typed as "a" | "b" even in the cycle
Similar issues
I've found few simillar issues (e.g. 49837), but not one as simple as this case.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
7022, circular
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
If not inside any type of cycle (e.g.
while (true)
), dep is correctly typed as"a" | "b"
(see the playground link). So the actual value ofa
has not been used in the type information. Even if it has been the case, the cycle should break becausea.prop
is strongly defined and is not dependant in any case on thea = {prop: dep}
assignmentπ Expected behavior
dep
typed as"a" | "b"
even in the cycleSimilar issues
I've found few simillar issues (e.g. 49837), but not one as simple as this case.
The text was updated successfully, but these errors were encountered: