TypeScript/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt

49 lines
1.5 KiB
Text
Raw Normal View History

==== tests/cases/compiler/fatarrowfunctionsErrors.ts (18 errors) ====
2014-07-13 01:04:16 +02:00
foo((...Far:any[])=>{return 0;})
~~~
!!! error TS2304: Cannot find name 'foo'.
2014-07-13 01:04:16 +02:00
foo((1)=>{return 0;});
~~
!!! error TS1005: ',' expected.
2014-07-13 01:04:16 +02:00
~
!!! error TS1005: ':' expected.
2014-07-13 01:04:16 +02:00
~
!!! error TS1005: ',' expected.
2014-07-13 01:04:16 +02:00
~
!!! error TS1128: Declaration or statement expected.
2014-07-13 01:04:16 +02:00
~
!!! error TS1128: Declaration or statement expected.
2014-07-13 01:04:16 +02:00
~~~
!!! error TS2304: Cannot find name 'foo'.
2014-07-13 01:04:16 +02:00
foo((x?)=>{return x;})
~~~
!!! error TS2304: Cannot find name 'foo'.
2014-07-13 01:04:16 +02:00
foo((x=0)=>{return x;})
~~~
!!! error TS2304: Cannot find name 'foo'.
2014-07-13 01:04:16 +02:00
var y = x:number => x*x;
~
!!! error TS1005: ',' expected.
2014-07-13 01:04:16 +02:00
~~
!!! error TS1005: ';' expected.
2014-07-13 01:04:16 +02:00
~
!!! error TS2304: Cannot find name 'x'.
2014-07-13 01:04:16 +02:00
~
!!! error TS2304: Cannot find name 'x'.
2014-07-13 01:04:16 +02:00
~
!!! error TS2304: Cannot find name 'x'.
2014-07-13 01:04:16 +02:00
false? (() => null): null;
// missing fatarrow
var x1 = () :void {};
~
!!! error TS1005: '=>' expected.
2014-07-13 01:04:16 +02:00
var x2 = (a:number) :void {};
~
!!! error TS1005: '=>' expected.
2014-07-13 01:04:16 +02:00
var x3 = (a:number) {};
~
!!! error TS1005: '=>' expected.
2014-07-13 01:04:16 +02:00
var x4= (...a: any[]) { };
~
!!! error TS1005: '=>' expected.