-
-
Notifications
You must be signed in to change notification settings - Fork 487
Description
Vue - Official extension or vue-tsc version
3.1.0
VSCode version
1.104.2
Vue version
3.5.22
TypeScript version
5.9.3
Steps to reproduce
- Visit the minimal reproduction linked below.
- In
App.vue
, hover overother-thing
at line 6, col 13 to see its inferred type.
What is expected?
Because MyParent
calls MyGenericChild
with number
passed to its generic parameter T
(due to :thing="1"
), the inferred attribute types on MyParent
that fall through to MyGenericChild
should assume number
as the type for T
, leading the other-thing
prop to have type number
.
What is actually happening?
Instead, other-thing
's type is unknown
, completely forgetting that MyParent
passed any generic argument to MyGenericChild
.
More broadly, the child component's attributes act as if the component was passed the widest possible types that each of its generic parameters extends
.
Link to minimal reproduction
Any additional comments?
This issue sounds similar to #5535, but it is not at all the same. #5535 suggests that the parent component should implicitly have inferred generic parameters, which I disagree with. Here, the parent component should not be generic. It simply forwards the attributes of the child component with generics specified, and that specified instance of the generic child component is the child component receiving the fallthrough attributes.