Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

narrowed type information disappears inside v-for #3339

Open
4 tasks done
NiloCK opened this issue Feb 7, 2022 · 1 comment
Open
4 tasks done

narrowed type information disappears inside v-for #3339

NiloCK opened this issue Feb 7, 2022 · 1 comment

Comments

@NiloCK
Copy link

NiloCK commented Feb 7, 2022

  • I have searched through existing issues (not exhaustively)
  • I have read through docs
  • I have read FAQ
  • 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.

lost narrowing in v-for

Play-by-play:

  • token is a marked.Token, which is a discriminated union type of ... tokens.
  • token.type === 'paragraph' narrows the type to marked.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.

@yoyo930021
Copy link
Member

Please provide a repro case.
https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants