Closed
Description
Compiler version
3.1.2-RC1-bin-20211102-82172ed-NIGHTLY
3.1.1-RC1
3.1.0
3.0.2
Minimized code
import scala.annotation.tailrec
class A {
def b = Option("a").map { x =>
@tailrec def loop(): Int = {
try {
2
} catch {
case _: Throwable =>
loop()
}
}
x
}
}
Output
[error] 10 | loop()
[error] | ^^^^^^
[error] | Cannot rewrite recursive call: it is not in tail position