Skip to content

Quickinfo incorrectly computes zero-candidate type parameter with contextual inference candidate #44879

Description

Bug Report

🔎 Search Terms

intellisense, contextual inference, call site inference
Related: #44821

🕗 Version & Regression Information

Tested with v4.3.4

⏯ Playground Link

Playground

💻 Code

m({foo: $("foo")});// unexpected errordeclareconstm:
<Sextendsstring>(s: {[_inS]: {$: NoInfer<S>}})=>voiddeclareconst$: <S,TextendsS>(s: T)=>{$: S}typeNoInfer<T>=[T][Textendsany ? 0 : never];

🙁 Actual behavior

Code does not compile

🙂 Expected behavior

Code should compile. Especially when the intellisense gets the type parameters right and also provides completions.

Expected type parameters and return type -

Expected completion -

But doesn't compile and gives error -

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Quick Infoe.g. hover text, tool-tips, and tooltips.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions