Skip to content

Give a better error when using a 'this' parameter in an arrow function. #13768

@DanielRosenwasser

Description

@DanielRosenwasser
let f = (this: number) => 100;

Currently this gives an error on the : saying that ) was expected. Instead, we should

  1. Gracefully parse.
  2. Give a grammar error saying that this parameters are not allowed in arrow functions.

Source: a user ran into this hazard here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions