Reputation: 27373
I try to debug a Scala program using IntelliJ's debugger. I'm wondering why the variable newx
is not listed in the "Variables"-panel of the debugger:
I'm especially surprised because newx is not a lazy val
. Is it omitted because it is never referenced later in the code and therefore garbage-collected?
Upvotes: 1
Views: 361
Reputation: 1226
Scala compiler's optimization deletes it because you are not using it.
You can see it by using it below or just use evaluate expression
feature of Idea and type variable name and run, it will probably find it.
Upvotes: 2