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
I shouldn't be able to construct a case class with a protected constructor in an Other class.
Notes
Looks like this was changed in #5830. I'd argue a protected constructor should mean everything a private one means with the addition that it can have subclasses because they can access the constructor. Meaning it shouldn't have an apply method (because it makes no sense in an object and may even will impact overload resolution) and therefore it shouldn't mixin its FunctionX either.
The text was updated successfully, but these errors were encountered:
For a real world case, I was playing around with removing RealTypeBounds by making TypeBounds non-abstract but with a protected constructor so AliasingBounds can still extend it. But the current implementation made TypeBounds' synthetic apply (which doesn't use unique) publicly accessible.
Isn't it too late to change that? I.e. wouldn't it be binary incompatible? On the other hand if I'm not mistaken Scala 2.13 applies the same modifiers to apply and copy as well. If I said private I didn't mean to allow sneaky developers to work around my validations by using apply or copy.
Compiler version
3.1.0
Minimized code
Output
Expectation
I shouldn't be able to construct a case class with a protected constructor in an Other class.
Notes
Looks like this was changed in #5830. I'd argue a protected constructor should mean everything a private one means with the addition that it can have subclasses because they can access the constructor. Meaning it shouldn't have an apply method (because it makes no sense in an object and may even will impact overload resolution) and therefore it shouldn't mixin its FunctionX either.
The text was updated successfully, but these errors were encountered: