vetur
vetur copied to clipboard
narrowed type information disappears inside `v-for`
- [x] I have searched through existing issues (not exhaustively)
- [x] I have read through docs
- [x] I have read FAQ
- [x] I have tried restarting VS Code or running
Vetur: Restart VLS
Info
-
Platform: Linux
-
Vetur version: 0.35.0
-
VS Code version: 1.63.2
-
Typescript version: ^3.5.3 (pkg.json), 3.9.10 (yarn.lock)
-
"vue": "^2.6.10", 2.6.14 (yarn.lock)
-
"vue-class-component": "^6.3.2", 6.3.2 (yarn.lock)
-
"@typescript-eslint/eslint-plugin": "^4.18.0",
-
"@typescript-eslint/parser": "^4.18.0",
Problem
no vetur error message, just getting incorrect warnings on a narrowed type.

Play-by-play:
tokenis amarked.Token, which is a discriminated union type of ... tokens.token.type === 'paragraph'narrows the type tomarked.Tokens.Paragraph- (line 44) correct narrowed type is inferred
- (line 47) the inferred type information is lost
Reproducible Case
n/a. Can attempt at a later date if necessary.
Please provide a repro case. https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md