Closed
Description
Example:
class Biff {}
class Bang {}
interface Callback {
(...biffs: Biff[]);
}
function foo(callback: Callback) {
callback(new Biff(), new Biff());
}
foo((x: Biff, y: Bang) => console.log('whoa'));
foo((z: string, n: number) => console.log('huh'));
The closures passed as arguments in the two calls at the end, do not appear to get type-checked.
It's pretty plain that these closures will not be invoked with suitable arguments, yet the code appears to compile with no complaints.
How come this doesn't get type-checked?