You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import Vue from "vue"
import { ThisTypedComponentOptionsWithRecordProps } from "vue/types/options"
import { ExtendedVue } from "vue/types/vue"
export function defineComponent<
V extends Vue,
Data,
Methods,
Computed,
Props
>(
options?: ThisTypedComponentOptionsWithRecordProps<V, Data, Methods, Computed, Props>
): ExtendedVue<V, Data, Methods, Computed, Props> {
return Vue.extend(options)
}
🙁 Actual behavior
4.6.2:
$ npx tsc src/file.ts
src/file.ts:13:5 - error TS2322: Type 'ExtendedVue<Vue, Data, Methods, Computed, Props>' is not assignable to type 'ExtendedVue<V, Data, Methods, Computed, Props>'.
Type 'Data & Methods & Computed & Props & Vue' is not assignable to type 'Data & Methods & Computed & Props & V & Vue'.
Type 'Data & Methods & Computed & Props & Vue' is not assignable to type 'V'.
'V' could be instantiated with an arbitrary type which could be unrelated to 'Data & Methods & Computed & Props & Vue'.
13 return Vue.extend(options)
~~~~~~~~~~~~~~~~~~~~~~~~~~
I tried to change to the following, but the result is the same:
V extends Vue & Data & Methods & Computed & Props,
🙂 Expected behavior
4.5.5:
$ npx tsc src/file.ts
(no error)
The text was updated successfully, but these errors were encountered:
Bug Report
🔎 Search Terms
vue ts2322 could be instantiated with an arbitrary type
🕗 Version & Regression Information
Versions that exhibits the undesired behavior: 4.6.0-beta, 4.6.1-rc, 4.6.2, next
Version that works: 4.5.5
⏯ Playground Link
The playground doesn't support 4.6.2 or external packages (Vue in this case) as far as I can see.
💻 Code
package.json
tsconfig.json
src/file.ts
🙁 Actual behavior
4.6.2:
I tried to change to the following, but the result is the same:
🙂 Expected behavior
4.5.5:
The text was updated successfully, but these errors were encountered: