Skip to content

Leading infix operator not recognized before colon at EOL #12218

Closed
@odersky

Description

@odersky

As reported on contributors:

import language.experimental.fewerBraces
@main def runTest(): Unit =
  val arr = Array(1,2,3)
  if
    arr.isEmpty
    || :
      val first = arr(0)
      first != 1
  then println("invalid arr")
  else println("valid arr")

Expected: should compile

Actual:

-- [E006] Not Found Error: test.scala:6:4 --------------------------------------
6 |    || :
  |    ^^
  |    Not found: ||

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions