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
method copy in class X2 cannot be accessed as a member of X2
Both examples compiles with scalac 2.12 because only the canonical constructor is affected by the restriction of visibility.
i.e. both the apply in the companion object and the copy method should be accessible.
The text was updated successfully, but these errors were encountered:
Note that you should be able to hand-write your own apply or copy methods with the same signature as the default generated ones, and the compiler will just not generate these methods itself, so you can define them with whatever accessibility you want.
giabao
added a commit
to ohze/akka
that referenced
this issue
Mar 27, 2020
Using a private constructor with
case class
es cause other methods to be considered private.Repro 1:
trigger:
Repro 2:
trigger:
Both examples compiles with scalac 2.12 because only the canonical constructor is affected by the restriction of visibility.
i.e. both the
apply
in the companion object and thecopy
method should be accessible.The text was updated successfully, but these errors were encountered: