Unexpected error in param jsdoc tags for methods containing arguments - 4.6 RC regression #47949
Labels
Bug
A bug in TypeScript
checkJs
Relates to checking JavaScript using TypeScript
Domain: JavaScript
The issue relates to JavaScript specifically
Domain: JSDoc
Relates to JSDoc parsing and type generation
Domain: Quick Fixes
Editor-provided fixes, often called code actions.
Milestone
Bug Report
π Search Terms
jsdoc
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
An error occurs in the type of the
@param
jsdoc tag:Cannot find name 'some'.
π Expected behavior
No error occurs on the
@param
jsdoc tagNotes
This only happens if
arguments
is referenced in the body of the method.This behavior was introduced in #47257 (ping @a-tarasyuk )
The issue seems to be that if
arguments
is referenced thengetTypeFromTypeNode(lastJSDocParam.typeExpression.type)
(Line) is invoked to see if the the last parameter is an array type. The problem isgetTypeFromTypeNode
will add the diagnostics about being unable to findsome
even though in this context we probably don't want to add it.The text was updated successfully, but these errors were encountered: