2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/contextualTypingOfLambdaReturnExpression.ts(5,16): error TS2339: Property 'length' does not exist on type 'number'.
|
|
|
|
tests/cases/compiler/contextualTypingOfLambdaReturnExpression.ts(6,18): error TS2339: Property 'length' does not exist on type 'number'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/contextualTypingOfLambdaReturnExpression.ts (2 errors) ====
|
|
|
|
function callb(lam: (l: number) => void);
|
|
|
|
function callb(lam: (n: string) => void);
|
|
|
|
function callb(a) { }
|
|
|
|
|
|
|
|
callb((a) => a.length); // Ok, we choose the second overload because the first one gave us an error when trying to resolve the lambda return type
|
|
|
|
~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2339: Property 'length' does not exist on type 'number'.
|
2014-07-13 01:04:16 +02:00
|
|
|
callb((a) => { a.length; }); // Error, we picked the first overload and errored when type checking the lambda body
|
|
|
|
~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2339: Property 'length' does not exist on type 'number'.
|