-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
class X {
public go(data: { arg1: number }) { }
}
class Y {
public x?: { call: () => void } = { call: () => console.log('x?.call();') }
public go(data: { arg1: number, arg2?: string }) { }
}
let x = new X(), y = new Y();
// error TS2349: Cannot invoke an expression whose type lacks a call signature.
// Type '((data: { arg1: number; }) => void) | ((data: { arg1: number; arg2?: string; }) => void)' has no compatible call signatures.
let go: typeof x.go | typeof y.go = x.go;
go({ arg1: 0 });
// error: Optional Chaining in typescript 3.7.x
y?.x.call();
Metadata
Metadata
Assignees
Labels
No labels