1class Foo {
2 save(callback: (n: number) => any) : void {
3 callback(42);
4 }
5}
6var foo = new Foo();
7
8var strCallback = (result: string) : void => {
9 alert(result);
10}
11var numCallback = (result: number) : void => {
12 alert(result.toString());
13}
14
15foo.save(strCallback); // not OK
16foo.save(numCallback); // OK