Skip to content

Incorrect assertion in quick fix code #46615

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Extracted from #38062

// @noImplicitAny: true

type Rest = (...string) => void;
type Public = (public string) => void;

Request quick fixes for this code snippet.

Expected Correct quick fixes

Actual

Error: Debug Failure. add-name-to-nameless-parameter operates on identifiers, but got a DotDotDotToken
    at makeChange (TYPESCRIPT_DIR\lib\tsserver.js:145716:33)
    at TYPESCRIPT_DIR\lib\tsserver.js:145707:96
    at Function.ChangeTracker.with (TYPESCRIPT_DIR\lib\tsserver.js:143896:17)
    at Object.getCodeActions (TYPESCRIPT_DIR\lib\tsserver.js:145707:64)
    at TYPESCRIPT_DIR\lib\tsserver.js:145087:77
    at Object.flatMap (TYPESCRIPT_DIR\lib\tsserver.js:522:25)
    at Object.getFixes (TYPESCRIPT_DIR\lib\tsserver.js:145087:23)
    at TYPESCRIPT_DIR\lib\tsserver.js:159943:35
    at Object.flatMap (TYPESCRIPT_DIR\lib\tsserver.js:522:25)
    at Proxy.getCodeFixesAtPosition (TYPESCRIPT_DIR\lib\tsserver.js:159941:23)
    at IOSession.Session.getCodeFixes (TYPESCRIPT_DIR\lib\tsserver.js:171425:64)
Error: Debug Failure. add-name-to-nameless-parameter operates on identifiers, but got a PublicKeyword
    at makeChange (TYPESCRIPT_DIR\lib\tsserver.js:145716:33)
    at TYPESCRIPT_DIR\lib\tsserver.js:145707:96
    at Function.ChangeTracker.with (TYPESCRIPT_DIR\lib\tsserver.js:143896:17)
    at Object.getCodeActions (TYPESCRIPT_DIR\lib\tsserver.js:145707:64)
    at TYPESCRIPT_DIR\lib\tsserver.js:145087:77
    at Object.flatMap (TYPESCRIPT_DIR\lib\tsserver.js:522:25)
    at Object.getFixes (TYPESCRIPT_DIR\lib\tsserver.js:145087:23)
    at TYPESCRIPT_DIR\lib\tsserver.js:159943:35
    at Object.flatMap (TYPESCRIPT_DIR\lib\tsserver.js:522:25)
    at Proxy.getCodeFixesAtPosition (TYPESCRIPT_DIR\lib\tsserver.js:159941:23)
    at IOSession.Session.getCodeFixes (TYPESCRIPT_DIR\lib\tsserver.js:171425:64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.Effort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".FixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions