Description
Issue Description
When I try to pass an object to mergeWebpack
TypeScript complains that the type is not correct.
The type definition for mergeWebpack
:
export declare function mergeWebpack(mergeFn: (config: Partial<webpack.Configuration>, env: IWebpackEnv) => any | Partial<webpack.Configuration>): void;
If I try to call mergeWebpack
with an object that satisfies Partial<webpack.Configuration>
TypeScript complains.

I feel this is a weird TypeScript bug because the type reported in the error message does not match the union type.
It's also weird that to find this bug I had to play with the ordering of the union types to get TypeScript to complain.

Place the function definition on the left side of the union type and TS will complain that the right side does not exist but it will not complain that Function type notation must be parenthesized when used in a union type.(1385)
Reproduction
No response
Relevant log output (if applicable)
No response
Environment
No response
Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct