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

Cannot pause inside inner class && of class A+B in Scala 2 #508

Closed
adpi2 opened this issue Jul 14, 2023 · 2 comments · Fixed by #524
Closed

Cannot pause inside inner class && of class A+B in Scala 2 #508

adpi2 opened this issue Jul 14, 2023 · 2 comments · Fixed by #524
Labels
bug Something isn't working
Milestone

Comments

@adpi2
Copy link
Member

adpi2 commented Jul 14, 2023

I have absolutely no idea of why in Scala 2 there are no breakpoints inside A+B$$amp$amp$#x in file RuntimeEvaluatorTests.scala:898
I launched the same program in a debug session and placed breakpoints on the whole method. Never reached them

Originally posted by @iusildra in #484 (comment)

@adpi2 adpi2 added the bug Something isn't working label Jul 14, 2023
@adpi2 adpi2 added this to the 3.2.x milestone Jul 14, 2023
@iusildra
Copy link
Contributor

iusildra commented Jul 21, 2023

I think I found the problem.
In Scala2Unpickler#skipScala:43 there is a matchingMethods.forAll(skip). If matchingMethods is empty (it did not find a proper method), it will return true. The quick fix would be to add a check matchingMethods.isEmpty

When digging a bit the problem seems to be with Scala2Unpickler#matchSymbol

  • matchName & matchSignature work as expected
  • matchOwner fails because String.split takes a regex and the class name is A$plusB, which is not a valid regex. So the problem appear to be with classes whose names contain special characters

I'll add the fix for the matchOwner but what should we do about the matchingMethods.isEmpty ?

@adpi2
Copy link
Member Author

adpi2 commented Jul 22, 2023

what should we do about the matchingMethods.isEmpty ?

It skips the method on purpose because it assumes the method is a mixin-forwarder. An improvement which is on the todo list of @aymanelamyaghri is to find the mixin -forwarder in the trait to validate that it is indeed a mixin-forwader. Then we will be able to do what you suggest: skip should return false is the matchingMethods is empty.

I'll add the fix for the matchOwner

Nice, that should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants