Skip to content

Missing backticks on operator in colon EOL rewrite #22650

Open
@som-snytt

Description

@som-snytt

Compiler version

3.7

Minimized code

def g =
  2
  .+ {
    3
  }

  def receive =
    case ReceiveTimeout =>
      val msg = "Titivate timed out!"
      logBranch.error(msg)
      throw new RuntimeException(msg)

    case Run =>
      gameRepo
        .countSec(_.checkable)
        .foreach: total =>
          lila.mon.round.titivate.total.record(total)
          gameRepo
            .docCursor(Query.checkable)
            .documentSource(100)
            .via(gameRead)
            .via(gameFlow)
            .toMat(LilaStream.sinkCount)(Keep.right)
            .run()
            .addEffect(lila.mon.round.titivate.game.record(_))
            .>> {
              gameRepo
                .countSec(_.checkableOld)
                .dmap(lila.mon.round.titivate.old.record(_))
            }
            .monSuccess(_.round.titivate.time)
            .logFailure(logBranch)
            .addEffectAnyway(scheduleNext())

Output

def g =
  2
  .+ :
    3

  def receive =
    case ReceiveTimeout =>
      val msg = "Titivate timed out!"
      logBranch.error(msg)
      throw new RuntimeException(msg)

    case Run =>
      gameRepo
        .countSec(_.checkable)
        .foreach: total =>
          lila.mon.round.titivate.total.record(total)
          gameRepo
            .docCursor(Query.checkable)
            .documentSource(100)
            .via(gameRead)
            .via(gameFlow)
            .toMat(LilaStream.sinkCount)(Keep.right)
            .run()
            .addEffect(lila.mon.round.titivate.game.record(_))
            .>> :
              gameRepo
                .countSec(_.checkableOld)
                .dmap(lila.mon.round.titivate.old.record(_))
            .monSuccess(_.round.titivate.time)
            .logFailure(logBranch)
            .addEffectAnyway(scheduleNext())

Expectation

Operator >> requires backticks for less-brace syntax.

lichess-org/lila#17036 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions