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 -
