-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
vuejs/language-tools
#3536Labels
❗ p4-importantPriority 4: this fixes bugs that violate documented behavior, or significantly improves perf.Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.scope: types
Description
Vue version
3.3.4
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-tpwnzy?file=src/App.vue
Steps to reproduce
Run "turbo typecheck" inside StackBlitz.
What is expected?
Either
ref<InstanceType<typeof WithGeneric<number>>>()
or
ref<InstanceType<typeof WithGeneric>>()
should generate correct typings.
What is actually happening?
src/App.vue:6:28 - error TS2344: Type 'typeof WithGeneric<number>' does not satisfy the constraint 'abstract new (...args: any) => any'.
Type 'typeof WithGeneric<number>' provides no match for the signature 'new (...args: any): any'.
6 const a = ref<InstanceType<typeof WithGeneric<number>>>(); // type error
~~~~~~~~~~~~~~~~~~~~~~~~~~
src/App.vue:7:28 - error TS2344: Type '<T>(__VLS_props: Options<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps, __VLS_ctx?: Pick<{ props: Options<...>; expose(exposed: { ...; }): void; attrs: any; slots: {}; emit: any; }, "attrs" | ... 1 more ... | "slots"> | undefined, __VLS_setup?: { props: Options<...>; expose(exposed: { ...; }): void;...' does not satisfy the constraint 'abstract new (...args: any) => any'.
Type '<T>(__VLS_props: Options<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps, __VLS_ctx?: Pick<{ props: Options<...>; expose(exposed: { ...; }): void; attrs: any; slots: {}; emit: any; }, "attrs" | ... 1 more ... | "slots"> | undefined, __VLS_setup?: { ...; }) => VNode<...> & { ...; }' provides no match for the signature 'new (...args: any): any'.
7 const b = ref<InstanceType<typeof WithGeneric>>(); // type error
~~~~~~~~~~~~~~~~~~
System Info
No response
Any additional comments?
No response
jd-solanki, LQ6666666, an501920078, FlareZh, gl-ruslan-honchar and 20 more
Metadata
Metadata
Assignees
Labels
❗ p4-importantPriority 4: this fixes bugs that violate documented behavior, or significantly improves perf.Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.scope: types