"-language:strictEquality" causes debugger to fail running code in a live session
phrmoy opened this issue · comments
The console available for running arbitrarty code with objects within scope fails to run code when the compiler flag "-language:strictEquality" is turned on.
Upon removing the flag, I am able to run arbitrary code normally.
Using Scala 3.3.0 and sbt 1.9.1.
Thank you.
Pedro
Some additional background from me:
I was wondering if we could filter out some settings that we know will not influence the result of the evaluation in a negative way. It's really not necessary to follow the exact same rules when debugging and we might be a bit too strict here.
Thanks for the report!
I was wondering if we could filter out some settings that we know will not influence the result of the evaluation in a negative way. It's really not necessary to follow the exact same rules when debugging and we might be a bit too strict here.
Sure, we did that already for some options and we can also filter -language:strictEquality
. We "just" need to make sure that removing it does not change the semantic of the existing code nor prevents it from compiling.
Btw, it's worth noting that the code fails because of code like this if (foo == null) then...
This can be solved in code as well by simply looking for equality checks and add the following
@targetName("...") given CanEqual[..., Null] = CanEqual.derived
With or without -language:strictEquality
, the code will work.