Description
TypeScript Version: 3.9.1-rc
Search Terms:
No overload matches this call
Code
export interface SyncNgccOptions {
basePath: string;
targetEntryPointPath?: string;
async?: false;
}
export type AsyncNgccOptions = Omit<SyncNgccOptions, 'async'> & { async: true };
export function process(options: AsyncNgccOptions): Promise<void>;
export function process(options: SyncNgccOptions): void;
export function process(options: AsyncNgccOptions | SyncNgccOptions): void | Promise<void> {
return mainNgcc(options);
}
export function mainNgcc(options: AsyncNgccOptions): Promise<void>;
export function mainNgcc(options: SyncNgccOptions): void;
export function mainNgcc(options: AsyncNgccOptions | SyncNgccOptions): void | Promise<void> {
}
Expected behavior:
No error as per TS 3.8
Actual behavior:
Error
No overload matches this call. Overload 1 of 2, '(options: AsyncNgccOptions): Promise', gave the following error. Argument of type 'SyncNgccOptions | AsyncNgccOptions' is not assignable to parameter of type 'AsyncNgccOptions'. Type 'SyncNgccOptions' is not assignable to type 'AsyncNgccOptions'. Type 'SyncNgccOptions' is not assignable to type '{ async: true; }'. Types of property 'async' are incompatible. Type 'false | undefined' is not assignable to type 'true'. Type 'undefined' is not assignable to type 'true'. Overload 2 of 2, '(options: SyncNgccOptions): void', gave the following error. Argument of type 'SyncNgccOptions | AsyncNgccOptions' is not assignable to parameter of type 'SyncNgccOptions'. Type 'AsyncNgccOptions' is not assignable to type 'SyncNgccOptions'. Types of property 'async' are incompatible. Type 'true' is not assignable to type 'false | undefined'.
Related Issues: