Skip to content

Conversation

@hamzaremmal
Copy link
Member

To preserve the same source compatibility, we mark toString and hashCode as methods with empty parameter lists in all the inherited files from Scala 2. Note that I checked for other java defined methods that would qualify for this change but I couldn't find any (reviewer should double check too since we cannot fix this after 3.8.0).

Closes #19616
Supersedes #24452

@hamzaremmal hamzaremmal requested a review from a team as a code owner November 17, 2025 12:48
@hamzaremmal hamzaremmal requested a review from sjrd November 17, 2025 12:49
@hamzaremmal hamzaremmal added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Nov 17, 2025
@hamzaremmal hamzaremmal added this to the 3.8.0 milestone Nov 17, 2025
@som-snytt
Copy link
Contributor

If Scala 3 is not going to add parens to the overriding definition, surely it should warn. Otherwise it's a gotcha forever.

I'll contribute a warning if it is deemed useful.

@hamzaremmal
Copy link
Member Author

No need for a warning, this is only to not break source compatibility and already existing macros. Scala 2 already added those parentheses for Java defined methods. This is just porting those changes only in the Scala 2 inherited files. You see that Tuple.scala didn't change this.

@sjrd I just saw that I had some unsaved changes locally that had to do with this PR, I'll include them and go over the list a second time.

@som-snytt thank you for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it.

3 participants