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
typeAny<TextendsObject>={[key:string]: T;};typeResult=string|Result[]|Any<Result>;// error TS2456: Type alias 'Result' circularly references itself.
Works :-
type ResultObject = {
[key:string]: Result;
};
type Result = string | Result[] | ResultObject;
Fails :-
type ResultObject = {
[key:string]: Result;
};
type ResultArray<T> = T[];
type Result = string | ResultArray<Result> | ResultObject; // error TS2456: Type alias 'Result' circularly references itself.
It looks like it is a Generic Parameterization issue.
π Actual behavior
Throwing Error on compilation error TS2456: Type alias 'Result' circularly references itself.
π Expected behavior
To support self referential, recursive, and mutually recursive types.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
π Search Terms
microsoft#61062 Self Referential Types, Recursive Types, Mutually Recursive Types.
π Version & Regression Information
Failing on Main 32ebd28
β― Playground Link
https://www.typescriptlang.org/play/?#code/C4TwDgpgBAggdiAPAFShAHsCcAmBnKAeQCMArCAY2AD4oBeKAbwCgo2oBtAawhAC48wAE4BLOAHMAunyjIA3MwC+cqM2ahIUAEoQ8AVwA2welEGiJUAD7bdh4B0lXYCRDv1HqKgPRe0QoQD2QrIAygBMACwArABsMsjg0ACGBiJJBADkbnYZUBQiQhSGSUIGIFBCEABmEJVwFLpQIsB4EAZVAHTMQA
π» Code
Fails :-
Works :-
Fails :-
It looks like it is a Generic Parameterization issue.
π Actual behavior
Throwing Error on compilation error TS2456: Type alias 'Result' circularly references itself.
π Expected behavior
To support self referential, recursive, and mutually recursive types.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: