Closed
Description
using Scala 2.13.4
According to scala syntax (https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html)
Generator ::= Pattern1 ‘<-’ Expr {[semi] Guard | semi Pattern1 ‘=’ Expr}
several guards on the same line is a valid code.
But unfortunately, if you place several guards on the same line, starting from a new line, a compilation error occurs.
for {
x <- 1 to 5 if true if true
} yield x
for {
x <- 1 to 5 if true
if true
} yield x
for {
x <- 1 to 5
if true if true
} yield x
for {
x <- 1 to 5
if true
if true
} yield x
related issue: https://youtrack.jetbrains.com/issue/SCL-13220