Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types of lambda parameters without parenthesis #361

Open
susliko opened this issue Sep 19, 2023 · 0 comments
Open

Types of lambda parameters without parenthesis #361

susliko opened this issue Sep 19, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@susliko
Copy link
Collaborator

susliko commented Sep 19, 2023

Commit of tree-sitter-scala you tested this on

59ab070

A code sample showing the error

xs.map { x: Int => x }

Show the error node

(compilation_unit [0, 0] - [1, 0]
  (call_expression [0, 0] - [0, 22]
    function: (field_expression [0, 0] - [0, 6]
      value: (identifier [0, 0] - [0, 2])
      field: (identifier [0, 3] - [0, 6]))
    arguments: (block [0, 7] - [0, 22]
      (ascription_expression [0, 9] - [0, 15]
        (identifier [0, 9] - [0, 10])
        (type_identifier [0, 12] - [0, 15]))
      (ERROR [0, 16] - [0, 21]))))

What do you expect the tree to look like

It should be recognized as a lambda expression

Where are you experiencing this error?

This syntax was allowed in Scala 2. E.g. ClassFileWriters.scala

@susliko susliko added the bug Something isn't working label Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant