Skip to content
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

Incorrect type inference in template language service if using explicit type with child forms #25

Open
ShacharHarshuv opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something isn't working DX

Comments

@ShacharHarshuv
Copy link
Owner

This bug is superspecific and I have no idea why it happens, but in this case:

myForm = form<{name: string}>({name: form('')});

If I use myForm in the template, it's inferred in the IDE as WritableForm<string>, though in typescript and in build it's correctly inferred as WritableForm<{name: string}>.

There is no runtime issues here, it's purely a DX issue.

Weirdly, we need both the explicit type and the form('') usage for this to reproduce.

@ShacharHarshuv ShacharHarshuv added bug Something isn't working DX labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DX
Projects
None yet
Development

No branches or pull requests

1 participant