mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-21 08:25:43 -05:00
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:
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
@@ -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
|
||||
~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user