vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 403 forks source link

Types wrongly inferred in v-for #4956

Closed matteoscaramuzza closed 3 weeks ago

matteoscaramuzza commented 3 weeks ago

Vue - Official extension or vue-tsc version

2.1.8

VSCode version

using WebStorm 2024.2.4

Vue version

3.5.12

TypeScript version

5.6.3

System Info

System:
    OS: macOS 15.0.1
    CPU: (8) arm64 Apple M1
    Memory: 193.92 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.1 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.9.0 - /usr/local/bin/npm
    pnpm: 9.12.2 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 130.0.6723.70
    Safari: 18.0.1

package.json dependencies

No response

Steps to reproduce

Installing the latest version of vue-tsc and using a v-for is not setting the correct type to the looped item:

image

image

Causing the called methods that accepts the correctly type object to break:

image

What is expected?

In the example, it's expected for header to be of type ITableHeader

What is actually happening?

In the example, header is not of type ITableHeader but has all its properties

Link to minimal reproduction

No response

Any additional comments?

No response

matteoscaramuzza commented 3 weeks ago

Rolling back to v2.0.29 fixes the problem

KazariEX commented 3 weeks ago

Duplicate of #4948

matteoscaramuzza commented 3 weeks ago

Duplicate of #4948

Sorry @KazariEX, I've searched for this issue only in still open issues. I've should have searched also in the closed ones.

Thank you!