Closed
Description
Minimized code
object EnumTest:
@main
def run(): Unit =
try
enum Color:
case Red, Green, Blue
def paint(color: Color): Unit =
println(s"painting with color $color")
paint(Color.Red)
catch
case e => println(e)
Output
java.lang.StackOverflowError
Expectation
painting with color Red
after defining and using an enum inside a function, when the function is ran, it produces a StackOverflowError. if the enum is defined outside of the function, then everything works.