google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.17k stars 581 forks source link

Arrow functions missing support for params annotations and return types #1580

Open viatsyshyn opened 9 years ago

viatsyshyn commented 9 years ago
var a = (@Ann a:number):string => {};
traceured.js:1:10: Unexpected token @
traceured.js:1:16: Unexpected token :
traceured.js:1:24: Semi-colon expected
traceured.js:1:24: Unexpected token :
traceured.js:1:25: Semi-colon expected
arv commented 9 years ago

@vicb @vojtajina

arv commented 9 years ago

It is not clear how this can work since the arrow parameters is a cover grammar for paren expressions. TypeScript uses back tracking which is not acceptable.