为什么IntelliJ无法调试线路
println(s"foo: $nr")
在下面的代码中?
我在做错什么吗?
当我删除/注释该行时
val neverUsed = () => f
调试工作正常,并且按预期在调试器窗口中停止执行。
object Test {
def wrap(f: Int => String): Int => String = {
val foo = (nr: Int) => {
println(s"foo: $nr") // <--- Breakpoint added here!
// This declaration seems to prevent debugging.
// when removed or commented out debugging works as expected.
val neverUsed = () => f
s"FOO $nr"
}
nr: Int => foo(nr)
}
def main(args: Array[String]) {
println(wrap(_.toString)(123))
}
}