TypeScript/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt
2014-09-11 16:11:08 -07:00

49 lines
1.5 KiB
Plaintext

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