Skip to content

AllowUnresolveNames not working for completion getters/setters and property signature and declarationΒ #59554

@armanio123

Description

@armanio123

πŸ”Ž Search Terms

AllowUnresolveNames, "preserve type nodes"

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about AllowUnresolvedNames and preserve types

⏯ Playground Link

https://www.typescriptlang.org/play/?target=99#code/JYOwLgpgTgZghgYwgAgILIN4Chm+TAewIC5lgBbABwKjAAoAiAOgHoATAiAZ3AgA9gXMEwBWXBgEomAMSIBuHHgDmEMMgBGcKHQmkK1Wo1YduvAUNHipsggoC+WRwgA2cLl2QAhMlWcRyEOAe6NgsLMgAKlDASipQyAgEvqrABCCkDPp+AeBkvLCIKKgMyGyClK4AnshgABaCCUkVKWnEWGFoCGAArnDObR2EJMhwIJUKHSpqmtq6I2OY7eF4NbVQBADuyCAQWwCiUOvaDACyqrUEbNsEaln+gZBsTJIT4XbIjh17fJQQXRBsAbhIZ6Kg0ejMdicHiQczCMSSGTyJbIKYaLQ6UEGCHGaFmQTwqxIgiLDorOrrLY7faHGiMM51S7XW7JHKPZ4SV7Id5YOxAA

πŸ’» Code

interface A {
    foo: import("./doesntexist.js").Foo;
    get bar(): import("./doesntexist.js").Foo;
}


class B implements A {
// Trigger completion: "implement interface A" display this completion:
// Actual:
// foo: any;
// get bar(): any {
//     throw new Error("Method not implemented.");
// } 

// Expected:
// foo: import("./doesntexist.js").Foo;
// get bar(): import("./doesntexist.js").Foo {
//     throw new Error("Method not implemented.");
// } 
}

πŸ™ Actual behavior

Triggering completion uses any instead of the unresolved type.

πŸ™‚ Expected behavior

Completion should be the unresolved type instead of any

Additional information about the issue

Found in PR #59440

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions