Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@devanshj

Description

@devanshj
Issue body actions

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 -

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.