Covered more cases for arrow functions omitting arrows.

Specifically where we have a full signature followed by an open curly brace.
This commit is contained in:
Daniel Rosenwasser
2014-07-23 11:49:51 -07:00
parent 5b6bb5b649
commit 5fc2792297
4 changed files with 22 additions and 50 deletions

View File

@@ -1,4 +1,4 @@
==== tests/cases/compiler/arrowFunctionsMissingTokens.ts (39 errors) ====
==== tests/cases/compiler/arrowFunctionsMissingTokens.ts (31 errors) ====
module missingArrowsWithCurly {
var a = () { };
@@ -11,31 +11,15 @@
var c = (x) { };
~
!!! ',' expected.
~
!!! Cannot find name 'x'.
!!! '=>' expected.
var d = (x: number, y: string) { };
~
!!! ')' expected.
~
!!! ',' expected.
~
!!! Variable declaration expected.
~
!!! Cannot find name 'x'.
!!! '=>' expected.
var e = (x: number, y: string): void { };
~
!!! ')' expected.
~
!!! ',' expected.
~
!!! Variable declaration expected.
~~~~
!!! Variable declaration expected.
~
!!! Cannot find name 'x'.
~
!!! '=>' expected.
}
module missingCurliesWithArrow {

View File

@@ -1,4 +1,4 @@
==== tests/cases/compiler/fatarrowfunctionsErrors.ts (25 errors) ====
==== tests/cases/compiler/fatarrowfunctionsErrors.ts (18 errors) ====
foo((...Far:any[])=>{return 0;})
~~~
!!! Cannot find name 'foo'.
@@ -39,25 +39,11 @@
~
!!! '=>' expected.
var x2 = (a:number) :void {};
~
!!! ')' expected.
~
!!! ',' expected.
~
!!! Variable declaration expected.
~~~~
!!! Variable declaration expected.
~
!!! Cannot find name 'a'.
~
!!! '=>' expected.
var x3 = (a:number) {};
~
!!! ')' expected.
~
!!! ',' expected.
~
!!! Variable declaration expected.
~
!!! Cannot find name 'a'.
!!! '=>' expected.
var x4= (...a: any[]) { };
~
!!! '=>' expected.

View File

@@ -1,4 +1,4 @@
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ====
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (4 errors) ====
function fn() {
try {
} catch { // syntax error, missing '(x)'
@@ -10,9 +10,7 @@
~~~~~
!!! Statement expected.
~
!!! ';' expected.
~
!!! Cannot find name 'x'.
!!! '=>' expected.
finally{ } // error missing try
~~~~~~~