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
value m in traitA of typeInt and
value m in traitB of typeString
(Note:this can be resolved by declaring an override in traitMix.)
traitMixextends p.AwithB
Maybe my expectations are incorrect but I expected the package protected member to never conflict with another member outside of the definition package.
The text was updated successfully, but these errors were encountered:
@retronym said:
Here's a tighter look at this. Relevant spec extracts inline:
objectp {
traitA {
privatevalprivateMember=1private[p] valqualifiedPrivateMember=1
}
// The private modifier can be used with any definition or declaration in a template.// Such members can be accessed only from within the directly enclosing template and// its companion module or companion class. They are not inherited by subclasses and// they may not override definitions in parent classes.defusePrivate(b: Mix) =
b.privateMember // not a member// The modifier can be qualified with an identifier C (e.g. private[C]) that must// denote a class or package enclosing the definition. Members labeled with such a// modifier are accessible respectively only from code inside the package C or only// from code inside the class C and its companion module.defuseQualifiedPrivate(b: Mix) =
b.qualifiedPrivateMember // allowed, but should it be?
}
traitMixextends p.A
For the following code:
I get the message:
Maybe my expectations are incorrect but I expected the package protected member to never conflict with another member outside of the definition package.
The text was updated successfully, but these errors were encountered: