-
Notifications
You must be signed in to change notification settings - Fork 393
Open
Labels
Description
While debugging, watches display "Cannot evaluate because of compilation error(s): ......". This is annoying, and actually the same issue seems to prevent conditional breakpoints from working. This seems to occur whenever an inner class is present within the method.
Environment
- Operating System: Microsoft Windows [Version 10.0.19042.1348]
- JDK version: jdk-11.0.12
- Visual Studio Code version: 1.62.3 (user setup)
- Java extension version: Java(TM) by Red Hat v1.1.0
- Java Debugger extension version: v0.37.0
Steps To Reproduce
- Create the slightly modified "Hello World" by copy / pasting the code below.
- Add a breakpoint then debug.
- Set a watch expression for msg.length()
import java.util.List;
import java.util.ArrayList;
public class Hello {
public static void main(String[] args) {
class Position {
int x;
int y;
}
String msg = "Hello World";
List<Position> x = new ArrayList<>();
System.out.println(msg + x);
}
}
Current Result
Expected Result
msg.length() should evaluate to a number.
Additional Informations
If I move the "class Position {}" so that it is no longer an inner class then the debugger seems to work correctly.