Skip to content
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

Error: Debug Failure. at Object.assertDefined at Object.getJSDocHost #27341

Closed
minestarks opened this issue Sep 25, 2018 · 8 comments
Closed
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fixed A PR has been merged for this issue

Comments

@minestarks
Copy link
Member

TypeScript Version: 3.1.0-dev.20180925

git clone --depth=1 https://github.com/chemzqm/wept
cd wept
tsc --init
tsc --allowJs --checkJs

Compiler crashes with the callstack:

Error: Debug Failure.
    at Object.assertDefined (node_modules\typescript\lib\tsc.js:1268:24)
    at getJSDocHost (node_modules\typescript\lib\tsc.js:7723:25)
    at getHostSignatureFromJSDoc (node_modules\typescript\lib\tsc.js:7709:46)
    at Object.getParameterSymbolFromJSDoc (node_modules\typescript\lib\tsc.js:7700:20)
    at checkJSDocParameterTag (node_modules\typescript\lib\tsc.js:43646:21)
    at checkSourceElement (node_modules\typescript\lib\tsc.js:45970:28)
    at Object.forEach (node_modules\typescript\lib\tsc.js:169:30)
    at node_modules\typescript\lib\tsc.js:45896:31
    at Object.forEach (node_modules\typescript\lib\tsc.js:169:30)
    at checkSourceElement (node_modules\typescript\lib\tsc.js:45894:20)
@RyanCavanaugh
Copy link
Member

Also repros on 3.0

@RyanCavanaugh
Copy link
Member

Minimal repro

if (false) {
	/**
	 * @param {string} s
	 */
	const x = function (s) {
	};
}

The if expression has to be false 🤷‍♂️

@sandersn
Copy link
Member

sandersn commented Sep 27, 2018

Parent pointers aren't filled in for the @param tag. Pretty sure this is supposed to happen in the parser.

@sandersn
Copy link
Member

Introduced in 2.9

@sandersn
Copy link
Member

Specifically, bisecting leads to #23947, which was a fairly large change that added @callback and corrected handling of @template in conjunction with jsdoc type aliases.

@weswigham weswigham added Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output labels Sep 27, 2018
@sandersn
Copy link
Member

In the binder, unreachable code mistakenly skips the bindJSDoc call in bindChildrenWorker, which sets parent pointers. That's why it has to be if (false) and not if (!!false), for example.

@ghost
Copy link

ghost commented Oct 1, 2018

@sandersn Should this be closed?

@sandersn
Copy link
Member

sandersn commented Oct 1, 2018

Yes, not sure why github didn't catch it.

@sandersn sandersn closed this as completed Oct 1, 2018
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 3.1.2 milestone Oct 9, 2018
@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Oct 9, 2018
alexeagle pushed a commit to angular/angular-cli that referenced this issue Oct 16, 2018
alexeagle pushed a commit to angular/angular-cli that referenced this issue Oct 16, 2018
alexeagle pushed a commit to angular/angular-cli that referenced this issue Oct 16, 2018
alexeagle pushed a commit to angular/angular-cli that referenced this issue Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants