Skip to content

Crash in checkTypeReferenceNode when JSDoc tries to instantiate non-generic #17383

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
RyanCavanaugh opened this issue Jul 25, 2017 · 0 comments
Closed
Assignees
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation

Comments

@RyanCavanaugh
Copy link
Member

Found when trying to reverse engineer a repro for #17377

/**
 * @param {<T>(m: Boolean<T>) => string} somebody
 */
function sayHello(somebody) {
    alert('Hello ' + somebody);
}
C:\github\TypeScript\built\local\tsc.js:69844
                throw e;
                ^

TypeError: Cannot read property 'flags' of undefined
    at checkTypeReferenceNode (C:\github\TypeScript\built\local\tsc.js:39426:52)
    at checkSourceElement (C:\github\TypeScript\built\local\tsc.js:42606:28)
    at checkVariableLikeDeclaration (C:\github\TypeScript\built\local\tsc.js:40712:13)
    at checkParameter (C:\github\TypeScript\built\local\tsc.js:38879:13)
    at Object.forEach (C:\github\TypeScript\built\local\tsc.js:1463:30)
    at checkSignatureDeclaration (C:\github\TypeScript\built\local\tsc.js:39021:16)
    at checkSourceElement (C:\github\TypeScript\built\local\tsc.js:42594:28)
    at checkSourceElement (C:\github\TypeScript\built\local\tsc.js:42640:28)
    at checkSourceElement (C:\github\TypeScript\built\local\tsc.js:42626:28)
    at checkJSDocComment (C:\github\TypeScript\built\local\tsc.js:40221:21)
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jul 25, 2017
@RyanCavanaugh RyanCavanaugh marked this as a duplicate of #17525 Jul 31, 2017
@DanielRosenwasser DanielRosenwasser added Domain: JSDoc Relates to JSDoc parsing and type generation Salsa labels Aug 1, 2017
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 2.5 milestone Aug 1, 2017
@weswigham weswigham assigned weswigham and unassigned sandersn Aug 1, 2017
weswigham added a commit to weswigham/TypeScript that referenced this issue Aug 1, 2017
weswigham added a commit that referenced this issue Aug 2, 2017
* Fix #17383 - issue an error when jsdoc attempts to instantiate a builtin as a generic

* Fix comment

* Fix #17377 - only get type parameters from reference target if the type is a reference

* Fix #17525 - Add SyntaxKind.AsteriskToken to isStartOfType
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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
Projects
None yet
Development

No branches or pull requests

4 participants