Closed
Description
Compiler version
3.1.1
Minimized code
val a: Int = a
https://scastie.scala-lang.org/9Naw4C8JRuKQtPd0VXBXLw
No warnings or compilation errors
Expectation
Compiler error or warning.
Scala 2 gives value a in object Playground does nothing other than call itself recursively
Without warning, this is easy to create bugs like this. For eg:
def create[F[_], S](using enc: Encoder[S])(state: S, fsm: FSM[F, S, Cmd, Option[Stat]]) =
new Stat[F]:
val state = state
val fsm = fsm