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

Infix types in match type cases #360

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

Infix types in match type cases #360

susliko opened this issue Sep 19, 2023 · 0 comments
Labels
area/scala3 Scala 3 syntax 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

type F[T] = T match {
  case t *: EmptyTuple => t
  case t *: rest => t 
}

Show the error node

(compilation_unit [0, 0] - [4, 0]
  (type_definition [0, 0] - [3, 1]
    name: (type_identifier [0, 5] - [0, 6])
    type_parameters: (type_parameters [0, 6] - [0, 9]
      name: (identifier [0, 7] - [0, 8]))
    (ERROR [0, 12] - [0, 19]
      (type_identifier [0, 12] - [0, 13]))
    type: (structural_type [0, 20] - [3, 1]
      (ERROR [1, 2] - [1, 6])
      (infix_expression [1, 7] - [1, 22]
        left: (identifier [1, 7] - [1, 8])
        operator: (operator_identifier [1, 9] - [1, 11])
        right: (identifier [1, 12] - [1, 22]))
      (ERROR [1, 23] - [2, 21]
        (infix_expression [1, 26] - [2, 8]
          left: (identifier [1, 26] - [1, 27])
          operator: (identifier [2, 2] - [2, 6])
          right: (identifier [2, 7] - [2, 8]))
        (operator_identifier [2, 9] - [2, 11])
        (lambda_expression [2, 12] - [2, 21]
          parameters: (identifier [2, 12] - [2, 16])
          (identifier [2, 20] - [2, 21]))))))

What do you expect the tree to look like

t *: rest should be parsed as an infix type instead of infix expression

Where are you experiencing this error?

No response

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

No branches or pull requests

1 participant