Skip to content

Assert in inferFromUsages when typing function with rest args #20520

Closed
@RyanCavanaugh

Description

@RyanCavanaugh

Code:

function f(...

Trace:

Exception on executing command {"seq":403,"type":"request","command":"getCodeFixes","arguments":{"file":"c:/Throwaway/a.ts","startLine":1,"startOffset":12,"endLine":1,"endOffset":15,"errorCodes":[7019,1003]}}:

    Debug Failure. False expression: Found no references!

    Error: Debug Failure. False expression: Found no references!
    at getReferences (C:\github\TypeScript\built\local\tsserver.js:92872:26)
    at inferTypeForVariableFromUsage (C:\github\TypeScript\built\local\tsserver.js:92877:67)
    at C:\github\TypeScript\built\local\tsserver.js:92812:108
    at Object.map (C:\github\TypeScript\built\local\tsserver.js:1710:29)
    at getCodeActionForParameters (C:\github\TypeScript\built\local\tsserver.js:92812:24)
    at Object.getActionsForAddExplicitTypeAnnotation [as getCodeActions] (C:\github\TypeScript\built\local\tsserver.js:92771:28)
    at C:\github\TypeScript\built\local\tsserver.js:90978:33
    at Object.forEach (C:\github\TypeScript\built\local\tsserver.js:1511:30)
    at Object.getFixes (C:\github\TypeScript\built\local\tsserver.js:90977:16)
    at C:\github\TypeScript\built\local\tsserver.js:96798:35
    at Object.flatMap (C:\github\TypeScript\built\local\tsserver.js:1771:25)
    at Object.getCodeFixesAtPosition (C:\github\TypeScript\built\local\tsserver.js:96796:23)
    at IOSession.Session.getCodeFixes (C:\github\TypeScript\built\local\tsserver.js:104325:64)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (C:\github\TypeScript\built\local\tsserver.js:103203:61)
    at C:\github\TypeScript\built\local\tsserver.js:104488:88
    at IOSession.Session.executeWithRequestId (C:\github\TypeScript\built\local\tsserver.js:104479:28)
    at IOSession.Session.executeCommand (C:\github\TypeScript\built\local\tsserver.js:104488:33)
    at IOSession.Session.onMessage (C:\github\TypeScript\built\local\tsserver.js:104508:35)
    at Interface.<anonymous> (C:\github\TypeScript\built\local\tsserver.js:105760:27)
    at emitOne (events.js:96:13)
    at Interface.emit (events.js:191:7)
    at Interface._onLine (readline.js:241:10)
    at Interface._normalWrite (readline.js:384:12)
    at Socket.ondata (readline.js:101:10)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions