Skip to content

Look-ahead for arrow function expressions too permissive when encountering "()" #34

@DanielRosenwasser

Description

@DanielRosenwasser

When encountering code like

().toString();

We make a strange assumption, which is that the () belongs to an arrow function like the following:

() => x

This is weird because it bubbles up to nothing better than the error

Cannot find name 'toString'.

In this case, we should check to see if the next token is an arrow (=>).

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions