IntelliJ - No such instance method
intellij-idea, java, scala
Solution
EDIT
My answer is no longer valid after OP modified question (i.e. moved where the breakpoint actual is)..
A breakpoint is hit before the line is executed. So in this case `foo` has not yet been declared or instantiated (i.e. the `Foo` constructor has not yet been called). You'll need to put the breakpoint at the next line (or step over the current line) if you want to evaluate `foo`.
Problem
Using IntelliJ's 12 Ultimate, I'm running the following code in the Debugger: Java ``` import play.api.libs.json.JsValue; public class Foo { ... public JsValue toJson() { ... } public class FooExample { ... Foo foo = new Foo(); System.out.println("...); //<-- breakpoint ``` At the breakpoint, I right-clicked my source code and picked "Evaluate Expression," typing in: `foo.toJson()`. But the following error showed up: `No such instance method: play.api.libs.json.JsValue$class.com.foo.Foo.toJson ()` Am I doing something wrong? `Foo#toJson` calls Scala code, if that matters. EDIT I actually had the breakpoint after the instantiation of `Foo.` To those who downvoted it, I deserved it.