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
Given: trait with implemented protected method
When: instantiate that trait overriding protected method with public access modifier
Expect: overridden method is public
Actual: overridden method is still protected
Code:
classTest {
traitI {
protecteddeffunc():Unit= println("hello")
}
traitPIextendsI {
overridedeffunc():Unit=super.func()
}
vali=newI {
overridedeffunc():Unit=super.func()
}
valpi=newPI {
}
i.func() //still protected: method func in trait I cannot be accessed in Test.this.I
pi.func() //works
}
The text was updated successfully, but these errors were encountered:
Given: trait with implemented protected method
When: instantiate that trait overriding protected method with public access modifier
Expect: overridden method is public
Actual: overridden method is still protected
Code:
The text was updated successfully, but these errors were encountered: