-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolution
Milestone
Description
π Search Terms
inference annotated parameters context sensitive order
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
declare function test<T, A, B>(obj: {
ctx: T;
a: (a: A, ctx: T) => void;
b: (b: B, ctx: T, a: A) => void;
}): void;
test({
ctx: 'foo',
a: (a: string, ctx) => {},
b: (b: string, ctx, a) => {},
});
test({
ctx: 'foo',
b: (b: string, ctx, a) => {},
a: (a: string, ctx) => {},
});π Actual behavior
The second call doesn't infer properly
π Expected behavior
I'd expect the second call to be inferred as good as the first one
Additional information about the issue
related to #47599
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolution