Skip to content

JSDoc typedef parsing fails if type and name are separated by a newline #26774

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
tschaub opened this issue Aug 30, 2018 · 0 comments
Closed

Comments

@tschaub
Copy link
Contributor

tschaub commented Aug 30, 2018

TypeScript Version: 3.1.0-dev.20180830

Search Terms:

  • JSDoc
  • asterisk

Code

/** 
 * @typedef {function(string): boolean}
 * MyType
 */

/**
 * @param {MyType} func The function to call.
 * @param {string} arg The argument to call it with.
 * @returns {boolean} The return.
 */
function callIt(func, arg) {
  return func(arg);
}

Expected behavior:

No errors from tsc --pretty

Actual behavior:

main.js:7:12 - error TS2304: Cannot find name 'MyType'.

7  * @param {MyType} func The function to call.
             ~~~~~~

Related Issues:

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

No branches or pull requests

1 participant