Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug throws Cannot evaluate because of java.lang.NegativeArraySizeException: -2 when evaluating list size #628

Closed
kasiaMarek opened this issue Jan 8, 2024 · 5 comments · Fixed by #703

Comments

@kasiaMarek
Copy link
Contributor

In repo: https://github.com/asarkar/99-scala
In P01.scala set breakpoint at line 10 (case lst :: Nil => lst), and debug P01Suite.scala "last element of a non-empty list" test. Try to evaluate l.size, see Cannot evaluate because of java.lang.NegativeArraySizeException: -2.

More info in the original issue: scalameta/metals#5997.

dap version: v3.1.5

@adpi2
Copy link
Member

adpi2 commented Jan 8, 2024

Thanks for the report!

@asarkar

This comment was marked as abuse.

@adpi2
Copy link
Member

adpi2 commented Jan 9, 2024

@asarkar Thanks for the report and reproduction. Next time, could you avoid using such emphasis as: "the watch panel is completely broken". It can be perceived as aggressive and it won't help us fix the bug.

@asarkar

This comment was marked as abuse.

@adpi2
Copy link
Member

adpi2 commented May 1, 2024

The problem with this build is the compiler is configured with -rewrite -indent and so it tries to rewrite the file during compilation. I can fix it by automatically filtering out those options.

@adpi2 adpi2 closed this as completed in #703 May 1, 2024
@adpi2 adpi2 closed this as completed in 4cc7019 May 1, 2024
adpi2 added a commit that referenced this issue May 1, 2024
Fix #628: remove `indent` and `-rewrite` options when evaluating expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants