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

Return a more reasonable type for arrays. #4807

Merged
merged 1 commit into from
Nov 25, 2021
Merged

Return a more reasonable type for arrays. #4807

merged 1 commit into from
Nov 25, 2021

Conversation

cheese-git
Copy link
Contributor

Actually it caused a type error in my command line, which complained for missing properties: [Symbol.iterator], [Symbol.unscopables].

Actually it caused a type error in my command line, which complained for missing properties: [Symbol.iterator], [Symbol.unscopables].
@JensDll
Copy link
Contributor

JensDll commented Nov 25, 2021

This does break one of the type tests in ref.test-d.ts btw (looks like no actions were run for this one).
https://github.com/vuejs/vue-next/blob/4e1131e251c1e3c9278853b41a3458a71e702959/test-dts/ref.test-d.ts#L46
With the current change, tuple refs like [number, string] get widened to (string | number)[].

Take this Playground comparing the two versions

I think this issue requires some further investigation, perhaps a bit more information. Anyways, wanted to point out that the type does make a difference.

@yyx990803
Copy link
Member

yyx990803 commented Nov 26, 2021

FYI I reverted this in 6d46b36 since it turns out to be breaking existing type expectations.

Could you please provide a reproduction of the original case where your types were failing so we can look for a better fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants