Skip to content

JSDoc function type not parsed correctly when nested #19986

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

Open
weswigham opened this issue Nov 13, 2017 · 1 comment
Open

JSDoc function type not parsed correctly when nested #19986

weswigham opened this issue Nov 13, 2017 · 1 comment
Labels
Bug A bug in TypeScript Domain: JavaScript The issue relates to JavaScript specifically Domain: JSDoc Relates to JSDoc parsing and type generation
Milestone

Comments

@weswigham
Copy link
Member

TypeScript Version: 2.7.0-dev.201xxxxx

Code

  /**
   * @param {!Runtime.Extension} extension
   * @param {?function(function(new:Object)):boolean} predicate
   * @return {boolean}
   */
  _checkExtensionApplicability(extension, predicate) {
    return false;
  }

Expected behavior:
Strong types for extension and predicate.

Actual behavior:

front_end/Runtime.js(398,24): error TS1138: Parameter declaration expected.

(An error on the inner function, rather than a correctly constructed type)

@weswigham weswigham added Bug A bug in TypeScript Salsa labels Nov 13, 2017
@weswigham
Copy link
Member Author

weswigham commented Nov 13, 2017

Another example with a nested function type which also parses badly:

CookieTable.CookiesTable = class extends UI.VBox {
  /**
   * @param {function(!SDK.Cookie, ?SDK.Cookie): !Promise<boolean>=} saveCallback
   * @param {function()=} refreshCallback
   * @param {function()=} selectedCallback
   * @param {function(!SDK.Cookie, function())=} deleteCallback
   */
  constructor(saveCallback, refreshCallback, selectedCallback, deleteCallback) {
 }
}

@mhegazy mhegazy added the Domain: JSDoc Relates to JSDoc parsing and type generation label Nov 13, 2017
@mhegazy mhegazy added this to the TypeScript 2.7 milestone Nov 13, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.7, TypeScript 2.8 Jan 9, 2018
@mhegazy mhegazy modified the milestones: TypeScript 2.8, TypeScript 2.9 Mar 9, 2018
@mhegazy mhegazy modified the milestones: TypeScript 3.0, Future Jul 2, 2018
@weswigham weswigham added Domain: JavaScript The issue relates to JavaScript specifically and removed Domain: JavaScript The issue relates to JavaScript specifically Salsa labels Nov 29, 2018
@sandersn sandersn removed their assignment Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: JavaScript The issue relates to JavaScript specifically Domain: JSDoc Relates to JSDoc parsing and type generation
Projects
None yet
Development

No branches or pull requests

3 participants