Open
Description
Vue version
3.5.12
Link to minimal reproduction
Steps to reproduce
defineComponent
with a type parameter that has an extends
constraint, and use it to define a required
prop (see repro)
What is expected?
props.cols
is inferred properly
What is actually happening?
props.cols
inferred as
[{
type: PropType<ColDef<ItemType, ColKey>[]>;
required: true;
}] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<...> : V : V : {
type: PropType<ColDef<ItemType, ColKey>[]>;
required: true;
}
System Info
System:
OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K
Memory: 22.28 GB / 24.45 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 22.9.0 - ~/.nvm/versions/node/v22.9.0/bin/node
npm: 10.8.3 - ~/.nvm/versions/node/v22.9.0/bin/npm
Any additional comments?
note: using JSDoc annotations, but unsure how to replicate in TS due to the way generics interact with PropType
s. Here is the TS repro but not equivalent
since rows: ItemType[]
was inferred properly, it seems like #9546 is fixed? And since props.simplecols
is inferred properly, it is only failing when within a detailed prop definition