You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler produces the following error message:
Name clash between defined and inherited member:
defprintf(x$0: String|Null, x$1: Array[?<:Object|Null])
: java.io.PrintStream|Null in classPrintStream and
overridedefprintf(format: String|Null, args: Array[?<:Object|Null])
: java.io.PrintStream|Null in classMyPrintStream
have the same typeafter erasure.
It should not be an error that both methods have the same type since one is supposed to override the other.
As @smarter noted on Gitter, this might be a confusion between varargs and Array arguments.
Tested with Scala 3.0.2 and 3.1.1-RC1-bin-20210907-a47a81a-NIGHTLY
The text was updated successfully, but these errors were encountered:
Hi, given the following code that overrides a Java method under
-Yexplicit-nulls
:The compiler produces the following error message:
It should not be an error that both methods have the same type since one is supposed to override the other.
As @smarter noted on Gitter, this might be a confusion between varargs and Array arguments.
Tested with Scala 3.0.2 and 3.1.1-RC1-bin-20210907-a47a81a-NIGHTLY
The text was updated successfully, but these errors were encountered: