Skip to content

Typescript type checking of JS - Can't reliably use @type to set type... strange bug #41306

@David-Else

Description

@David-Else
  • VSCode Version: 1.19.1
  • OS Version: Fedora 27

Steps to Reproduce:

  1. enable type checking in .js file with // @ts-check
  2. paste this and hover over the variable gender
/** @type {number} */
let gender;

It should correctly say 'number', now change to:

/** @type {string} */
let gender;

It won't update, stays as a number. Now try:

/** @type {number} */
var gender;

It should correctly change. It will now take going from let to var to actually select the correct type.

It's not just the hover over info that is broken, it really does get the type wrong and that makes the rest of the application generate linting errors everywhere.

Something seems badly broken, can't use type checking, which would be awesome.

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions