Commit b6ad43d
committed
Better error for wrong return (: vs =>) in types
It's very ambiguous in expression position, so impossible to give a
better message from the parser. For example:
let f = (x: number) => number => x + 1;
~~
Should be ':'
But the parser doesn't know that 'number' isn't an expression now.1 parent fcc9823 commit b6ad43d
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2231 | 2231 | | |
2232 | 2232 | | |
2233 | 2233 | | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
2234 | 2244 | | |
2235 | 2245 | | |
2236 | 2246 | | |
| |||
0 commit comments