Closed
Description
TypeScript Version: 3.3.1
Search Terms:
Code
- when
strictFunctionTypes
is disabled - when first composed function parameter is optional
- when first
pipe
overload is zero parameters for first function
declare const pipe: {
// 0-argument first function
// Workaround: disable this overload
<A>(a: () => A): () => A;
// 1-argument first function
<A, B>(ab: (a: A) => B): (a: A) => B;
};
// Expected type: `(a: {} | undefined) => number`
// Actual type: `() => number`
const fn = pipe((_a?: {}) => 1);
Related Issues:
#29904