As pointed out this would be a breaking change, however it gave me another idea.
toString is not “some unknown Java method.” Scala already knows about
java.lang.Object and maps it specially to
scala.AnyRef. When scala code calls
toString it’s technically defined on
scala.Any. Scala already has to handle it specially somewhat, e.g., for
AnyVal. So it would not be a big deal for the SLS to say that
toString is no-args.
Indeed. However, how bad is that? After all if a method is defined squarely in Java-land (as opposed to a “shared” type like Any/AnyRef/Object), one would expect it to look less idiomatic. It’s not that much different than the fact that when you use
java.time you have to use
x.plus(y) rather than
x + y — Java APIs just aren’t scala-idiomatic.