We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action.match
I think this can be boiled down to a TypeScript issue. In the following example, foo is not renamed within match, but it should be:
foo
match
{ type MyActions = { foo: {}; bar: {} }; type Cases = Record<keyof MyActions, {}>; const match = (cases: Cases) => {} match({ foo: 1, bar: 2, }) }
If Record is replaced with mapped types, renaming does work:
Record
{ type MyActions = { foo: {}; bar: {} }; type Cases = { [key in keyof MyActions]: {} }; const match = (cases: Cases) => {} match({ foo: 1, bar: 2, }) }
I opened an issue on TypeScript to track this microsoft/TypeScript#20272.
Filing here in case other people find the same problem when using unionize!
(And thanks for the fantastic library.)
The text was updated successfully, but these errors were encountered:
This no longer appears to be an issue. Did we stop using Record in place of mapped types somewhere along the line?
Sorry, something went wrong.
Nothing has changed in the basic approach, my guess is the TS language service just got a little smarter at some point 🙂
No branches or pull requests
I think this can be boiled down to a TypeScript issue. In the following example,
foo
is not renamed withinmatch
, but it should be:If
Record
is replaced with mapped types, renaming does work:I opened an issue on TypeScript to track this microsoft/TypeScript#20272.
Filing here in case other people find the same problem when using unionize!
(And thanks for the fantastic library.)
The text was updated successfully, but these errors were encountered: