Skip to content

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

@minestarks

Description

@minestarks
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)

Activity

RyanCavanaugh

RyanCavanaugh commented on Sep 25, 2018

@RyanCavanaugh
Member

Also repros on 3.0

RyanCavanaugh

RyanCavanaugh commented on Sep 25, 2018

@RyanCavanaugh
Member

Minimal repro

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

The if expression has to be false 🤷‍♂️

sandersn

sandersn commented on Sep 27, 2018

@sandersn
Member

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

sandersn

sandersn commented on Sep 27, 2018

@sandersn
Member

Introduced in 2.9

sandersn

sandersn commented on Sep 27, 2018

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

added
BugA bug in TypeScript
CrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
on Sep 27, 2018
sandersn

sandersn commented on Sep 27, 2018

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

sandersn commented on Oct 1, 2018

@sandersn
Member

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

4 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sandersn@DanielRosenwasser@weswigham@RyanCavanaugh@minestarks

        Issue actions

          Error: Debug Failure. at Object.assertDefined at Object.getJSDocHost · Issue #27341 · microsoft/TypeScript