-
-
Notifications
You must be signed in to change notification settings - Fork 527
Description
Vue - Official extension or vue-tsc version
3.2.1 - 3.2.5
VSCode version
1.111.0
Vue version
3.5.30
TypeScript version
5.9.3
System Info
System:
OS: Windows 11 10.0.26200
CPU: (32) x64 AMD Ryzen 9 9950X3D 16-Core Processor
Memory: 50.48 GB / 93.61 GB
Binaries:
Node: 24.11.1 - C:\Program Files\nodejs\node.EXE
npm: 10.5.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 145.0.7632.160
Edge: Chromium (145.0.3800.70)
Firefox: 148.0 - C:\Program Files\Mozilla Firefox\firefox.exepackage.json dependencies
"dependencies": {
"vue": "^3.5.25"
},
"devDependencies": {
"@vue/tsconfig": "^0.8.1",
"typescript": "~5.9.3",
"vue-tsc": "^3.1.5"
}Steps to reproduce
- Have a TS class derived from
Arraythat overridespushto accept wider types than the array's actual type. - Iterate the array with v-for
- Observe the items are of the wider type allowed by
push, rather than the narrower type actually passed toextends Array<T>.
What is expected?
Elements produced by v-for are correctly typed as T from Array<T> as they were in 3.2.0 and earlier.
What is actually happening?
Elements produced by v-for are inferring the allowed inputs from the arguments of push, rather than from the outputs of the array's indexer or iterator.
Observe in the repro that the actual iterator and element types of the array are correctly T (string), not TInput (string | number). Seems to be a regression from #5896
Link to minimal reproduction
https://github.com/ascott18/2026-03-11-vue-lang-array-regression/blob/main/App.vue
Any additional comments?
Our framework Coalesce has special derived array types with extra functionality on them (notably, the ability for lower types to be pushed into them and get auto mapped into more complex types), similar to the repro. https://github.com/IntelliTect/Coalesce/blob/1e12ebd234d1d3e8642dbde1010c24c9aaaf6d88/src/coalesce-vue/src/viewmodel.ts#L2157-L2230