Skip to content

@param should not error on non-functions #22410

Closed
@sandersn

Description

@sandersn
// @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.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions