New issue
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
Small Type Inferencing Issue with Property<E, V> #249
Comments
au-z
changed the title
Small Typing Inferencing Issue with Property<E, V>
Small Type Inferencing Issue with Property<E, V>
Mar 30, 2024
Sent a bug report: microsoft/TypeScript#58016 |
Typescript contributors say that this problem will not be solved in the near future, so we are solving it ourselves. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @smalluban!
I was working on some side project and noticed that the type inferencing when passing properties as arguments has a small problem.
When passing a computed getter function to a factory function, the property is inferred as a function:
I was able to reproduce the issue here and I show a possible fix:
https://stackblitz.com/edit/vitejs-vite-xmqndb?file=package.json,src%2Fmain.ts,tsconfig.json&terminal=dev
In my experimenting, I found out that rearranging the union type for Property made a difference:
If you think re-arranging the union type wouldn't create any unforseen negative side-effects, I'm happy to author a quick PR. 👍
The text was updated successfully, but these errors were encountered: