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

Unexpected "any" type when components with generics and combined emits. #3379

Closed
FlareZh opened this issue Jul 7, 2023 · 1 comment · Fixed by #3533
Closed

Unexpected "any" type when components with generics and combined emits. #3379

FlareZh opened this issue Jul 7, 2023 · 1 comment · Fixed by #3533
Labels
enhancement New feature or request good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@FlareZh
Copy link

FlareZh commented Jul 7, 2023

When a component with generics(even they are not unused), and its generic type of defineEmits is combined by "&", the first-match's type of the first emit type will be "any" in the parent component if there aren't any other match which has the same type with it.

e.g.
The return type of update:modelValue in parent component is "any". If I change any other emits type to "string" or I change the position of update:modelValue in StoreEmits or PanelEmits, it would become "string".
image

Minimal repo

@johnsoncodehk johnsoncodehk added enhancement New feature or request good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Sep 24, 2023
@johnsoncodehk
Copy link
Member

johnsoncodehk commented Sep 24, 2023

This is a known limitation where past implementations were unable to infer things larger than 4 species (See #60), now resolved by #3585!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants