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

JSDoc multi-line properties within Array<Object> syntax parse differently than Object[] #30965

Open
mattlyons0 opened this issue Apr 16, 2019 · 0 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@mattlyons0
Copy link

TypeScript Version: 3.5.0-dev.20190416

Search Terms:
JSDoc @type @param @arg multi-line type literal Array<>

Code

/**
 * @param {Array<Object>} os - has a string and a number
 * @param {string} os[].s - the string
 * @param {number} os[].n - the number
 */
function f(os) { return os[0].s; }

Expected behavior:

It appears that #17352 implemented this correctly for when the first @param is @param {Object[]} but failed to consider the other syntax to write this in JSDoc: @param {Array<Object>}.

For ease of debugging I am looking at the output of Intellisense when hovering over os in the function. I'd expect the output to look as iti does when @param {Object[]} is used:
image

Actual behavior:
image

Playground Link:
Playground Link

Related Issues:
#11597

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Apr 16, 2019
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants