Open
Description
π Search Terms
error generic type parameter inferred context senstivie contextual parameter
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
declare function fn<P>(config: {
callback: (params: P) => (context: number, params: P) => number;
unrelated?: (arg: string) => void;
}): (params: P) => number;
export const result = fn({
callback: <T,>(params: T) => {
return (a: boolean, b) => (a ? 1 : 0); // this should error somewhere, boolean !== number
},
unrelated: (_) => {},
});
π Actual behavior
No error
π Expected behavior
It should error
Additional information about the issue
By hovering =>
we can see function<T>(params: T): {}
. This indicates anyFunctionType
leaked into .resolvedReturnType
of that signature.
Metadata
Metadata
Assignees
Labels
No labels