-
-
Notifications
You must be signed in to change notification settings - Fork 442
Regression in slot typings #5206
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
Comments
There should be no problem with this function itself. function __VLS_asFunctionalSlot<S>(slot: S): (props: NonNullable<S> extends (props: infer P) => any ? P : {}) => void; |
@KazariEX are you sure?
|
If the type is correct, you should be able to trigger |
@KazariEX could you please check the same example on 3.0.0-alpha.2? Because it looks like it's fixed now but I'm not 100% sure if it's because the errors are once again not correctly mapped back into the code. |
No, we did not make any fixes as the error originated from your type definition itself: <template>
<tr v-for="(item, j) in items" :key="j">
<td v-for="(column, index) in tuple" :key="column.key">
<!-- will trigger error at here -->
{{ slots[slotName(tuple, item, index)]({ value: getValue(tuple, item, index) }) }}
</td>
</tr>
</template> This is the equivalent code for The reason why the error is not displayed now is indeed due to incomplete mapping. |
@KazariEX is there a regression in 2.2.10 in that regard? Because the error disappeared. |
2.2.10 only picked a few error fixes from 3.0.0. As I provided the code above, you need to solve the type issue yourself. |
@KazariEX I don't get the error in the code above anymore with 2.2.10, so I guess there isn't anything to solve with the latest stable version of the language tools. |
Vue - Official extension or vue-tsc version
2.2.4
VSCode version
1.97.2
Vue version
3.5.13
TypeScript version
5.6.3
System Info
package.json dependencies
Steps to reproduce
Playground:
TabRend errors out at line 87 if you upgrade vue-tsc to 2.2.4 which has just been released.
What is expected?
The slot typings should be valid.
What is actually happening?
Link to minimal reproduction
https://play.vuejs.org/#eNrtWM1u20YQfpUJC0QyIEpx2l5YSk4apEAL1DEcuT2IOlDkyqFD7RJc0rGg6t07sz/kSpZk2Q0cFMhFJnf+v5mdGXrlvS2K/m3NvMALX/g+MJlnvPLTTMaznMGbalkwmZRZUfmaNODCr3ktWerfxqUE3x9F/HhRLrjP6zz3YylZWWWCP1ZDzWU8Zz7Rnq6E3RV5lmSVH/OlkdU8IFlVF5DH/HoYeZ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O0F7xI/Oz1aGWlVOepwEYX+0oJlszWueqC6Tyd/MY9eejcU7miCNEycBbJFofO5Jioa2VL7dE3sx1LP15UtYrfuV+KhS3E9wNmxbR33DIXQmYnbDkgqsk1P8OFEBpGyecXZB6QyVSbX9UOErkNXmEyD41CBG3ZNWhKoTm5FbqCjTg6uRYWugkUim1vWMhax+zxtTuoixurs2up6KDAPDhwDOMTVuhx1NzqcbCVBik2z6oo/u0F3YUQE4SFXP/B+EaXo7kq/uheoUchu18hKzqm/M1nmXbBhioAxOtkXhzJXCWE8IRBOznj2HlveKJn6zRn7C/w409zOsSueuhlUKt/5clDjFuwluUgv8CsmwYu9OqJ0pF2ixR8vIoRnIHWf5NAuo8ZZETdbtMmoWUseFQeMDPjrehdVMpEvX1dY5gqkHN8ot83lh3brZ8OYrhaRWqDe4z9GOhp3AZ2UpynY7N1x0VyGgj3NUZi+uzqauJWubTKrUIp+t/N18GwYUtof4N2AmQMkJFw4XeR0WInQ/iE2jhyN6parRaQAbH4KTV1O7EjbqDkfu6DM3zVWIX6ztJ+197cfChUYeCdV/hen0MEynj4XJ0fcwTNvaj4UJjTwzTK8Pw/T6sTA5+h6GaVv7sTChkWNgctrFZtdrGh0+m2a9+WW+/hcK2HTx
Any additional comments?
https://stackoverflow.com/questions/79460089/tuple-type-inference-in-vue-js-named-slots-with-typescript/
The text was updated successfully, but these errors were encountered: