Skip to content

@param should not error on non-functions #22410

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
sandersn opened this issue Mar 8, 2018 · 0 comments
Closed

@param should not error on non-functions #22410

sandersn opened this issue Mar 8, 2018 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Fixed A PR has been merged for this issue

Comments

@sandersn
Copy link
Member

sandersn commented Mar 8, 2018

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: a.js
// from util
/** @param {function} ctor - A big long explanation follows */
exports.inherits = require('inherits') // shouldn't error -- there is no function to check here

Expected behavior:
No error -- the external documentation for util.inherits is written on the export of the internal implementation of it. This is fine. Perhaps the compiler should require the type of the initializer to have a signature with a parameter named ctor, but right now it just looks at the syntax.

Actual behavior:
An error that inherits has no parameter named ctor.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation labels Mar 9, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Mar 28, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants