Closed
Description
From @rkirov at DefinitelyTyped/DefinitelyTyped#28044 (comment):
interface IDirectiveLinkFn<TScope> {
(scope: TScope): void;
}
interface IDirectivePrePost<TScope> {
pre?: IDirectiveLinkFn<TScope>;
post?: IDirectiveLinkFn<TScope>;
}
export let blah: IDirectiveLinkFn<number> | IDirectivePrePost<number> = (x: string) => {}
Expected:
Type '(x: string) => void' is not assignable to type 'IDirectiveLinkFn<number>'.
Types of parameters 'x' and 'scope' are incompatible.
Type 'number' is not assignable to type 'string'.
Actual:
Type '(x: string) => void' is not assignable to type 'IDirectiveLinkFn<number> | IDirectivePrePost<number>'.
Type '(x: string) => void' has no properties in common with type 'IDirectivePrePost<number>'.