Skip to content

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

Closed
@devanshj

Description

@devanshj

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 error

declare const m:
  <S extends string>(s: { [_ in S]: { $: NoInfer<S> } }) => void

declare const $: <S, T extends S>(s: T) =>
  { $: S }

type NoInfer<T> = [T][T extends any ? 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: 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