Skip to content

False postfix error from parser #12395

Closed
@soronpo

Description

@soronpo

Compiler version

v3.0.0-RC3

Minimized code

@main def main : Unit = 
  val x = 1

  val y = x match 
    case 1 => 1
    case _ =>
      println("bad")
      ???
  println(x)

https://scastie.scala-lang.org/ycgXIOkfQL6SJ6nhFOVTUg

Output

postfix operator `???` needs to be enabled
by making the implicit value scala.language.postfixOps visible.
----
This can be achieved by adding the import clause 'import scala.language.postfixOps'
or by setting the compiler option -language:postfixOps.
See the Scaladoc for value scala.language.postfixOps for a discussion
why the feature needs to be explicitly enabled.

Expectation

No error. The compiler seems to be misreading the indentation of the last println.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions