Skip to content

Parser error for type arguments with trailing comma #15394

Closed
@albertpchen

Description

@albertpchen

Compiler version

3.2.0-RC1-bin-20220602-42b5941-NIGHTLY

Minimized code

def bar[T] = ()

val foo = bar[
  Int,
]

Output

-- [E040] Syntax Error: scratch.scala:5:0 --------------------------------------
5 |]
  |^
  |an identifier expected, but ']' found

Expectation

It should parse and compile with no errors. The same code compiles fine with 3.1.2.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions