Skip to content

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

Closed
@tschaub

Description

@tschaub

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions