Skip to content

different type between the type declared in jsDoc and the actual type #9882

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

Closed
plantain-00 opened this issue Jul 22, 2016 · 1 comment · Fixed by #10671
Closed

different type between the type declared in jsDoc and the actual type #9882

plantain-00 opened this issue Jul 22, 2016 · 1 comment · Fixed by #10671
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@plantain-00
Copy link
Contributor

TypeScript Version: 2.0.0 beta

Code

/**
 * @type {{ [name: string]: string; }} variables
 */
const variables = {};

Expected behavior:
from VSCode(hover the variable), the type of the variables is { [name: string]: string; }
Actual behavior:
from VSCode(hover the variable), the type of the variables is {}[]

Seems the feature is powered bu salsa from typescript, so commit this here.

@mhegazy
Copy link
Contributor

mhegazy commented Jul 22, 2016

the issue is the index signature is not really part of the JSDoc schema. so it is not really expected here. probaly the correct syntax, which is not supported either, is {Object.<string, number>} as per http://usejsdoc.org/tags-type.html

@mhegazy mhegazy added the Bug A bug in TypeScript label Jul 22, 2016
@mhegazy mhegazy added this to the TypeScript 2.1 milestone Jul 22, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Sep 15, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants