Skip to content

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

@mjbvz

Description

@mjbvz

From @David-Else on January 8, 2018 18:6

  • 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

Copied from original issue: microsoft/vscode#41306

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions