Skip to content

Codefix for --noImplicitAny parameter: Error: Debug Failure. False expression: Token end is child end #29330

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

TypeScript Version: 3.3.0-dev.20190108

Search Terms: noimplicitany infer code fix codefix token end is child end

Code

function wrap(arr) {
  arr.sort(function (a: number, b: number) { return a < b ? -1 : 1 })
}

Expected behavior:

--noImplicitAny suggested fix on the arr parameter shouldn't crash.

There is no crash if you remove the function passed to .sort.

Actual behavior:

Error: Debug Failure. False expression: Token end is child end
    at processChildNode (C:\Code\typestat\node_modules\typescript\lib\typescript.js:106787:34)
    at C:\Code\typestat\node_modules\typescript\lib\typescript.js:106734:21
    at visitNode (C:\Code\typestat\node_modules\typescript\lib\typescript.js:16135:24)
    at Object.forEachChild (C:\Code\typestat\node_modules\typescript\lib\typescript.js:16306:24)
    at processNode (C:\Code\typestat\node_modules\typescript\lib\typescript.js:106733:20)
    at processChildNode (C:\Code\typestat\node_modules\typescript\lib\typescript.js:106793:21)
    at processChildNodes (C:\Code\typestat\node_modules\typescript\lib\typescript.js:106844:48)
    at C:\Code\typestat\node_modules\typescript\lib\typescript.js:106736:21
    at visitNodes (C:\Code\typestat\node_modules\typescript\lib\typescript.js:16140:24)
    at Object.forEachChild (C:\Code\typestat\node_modules\typescript\lib\typescript.js:16282:24)

Related Issues: Perhaps the same as #23942, but on the 1/8 nightly.

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 outputDomain: LS: Quick FixesEditor-provided fixes, often called code actions.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions