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
// NOT workingexporttypeJson=Array<Json>|Record<string,Json>|boolean|number|string|null;// WorkingexporttypeJson2=Array<Json2>|boolean|number|string|{[property: string]: Json2}|null;
🙁 Actual behavior
Type alias Json does not compile.
This is due to the Record type, which if changed into an indexed map start to work.
🙂 Expected behavior
I was expecting this to compile, since a Record with string as key seems to me as a valid alternative syntax.
Actually, also some linting rules suggest to avoid indexed maps in favor of Record<string,>.
But I am not 100% sure this is actually something that should be considered as a bug, or if there is some underlying difference that I do not know.
Regards.
The text was updated successfully, but these errors were encountered:
Bug Report
🔎 Search Terms
circular type alias, record, json
🕗 Version & Regression Information
In version 4.8.3 it does not compiles.
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Type alias Json does not compile.
This is due to the
Record
type, which if changed into an indexed map start to work.🙂 Expected behavior
I was expecting this to compile, since a Record with
string
as key seems to me as a valid alternative syntax.Actually, also some linting rules suggest to avoid indexed maps in favor of
Record<string,>
.But I am not 100% sure this is actually something that should be considered as a bug, or if there is some underlying difference that I do not know.
Regards.
The text was updated successfully, but these errors were encountered: