2014-07-13 01:04:16 +02:00
|
|
|
//// [assignLambdaToNominalSubtypeOfFunction.ts]
|
|
|
|
interface IResultCallback extends Function {
|
|
|
|
x: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
function fn(cb: IResultCallback) { }
|
|
|
|
|
|
|
|
fn((a, b) => true);
|
|
|
|
fn(function (a, b) { return true; })
|
|
|
|
|
|
|
|
|
|
|
|
//// [assignLambdaToNominalSubtypeOfFunction.js]
|
2015-02-07 03:45:09 +01:00
|
|
|
function fn(cb) { }
|
2014-07-13 01:04:16 +02:00
|
|
|
fn(function (a, b) { return true; });
|
|
|
|
fn(function (a, b) {
|
|
|
|
return true;
|
|
|
|
});
|