Skip to content

Types of lambda parameters without parenthesis #361

@susliko

Description

@susliko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions