I have a java class with a protected static method:
package parent; public class Parent { protected static void parentMethod() { System.out.println("I'm in parent static method"); } }
Prior to Scala 2.12.4 (2.12.3), I could call this method from another package as follows:
package child import parent.Parent class Child extends Parent { def childMethod = { println("I'm in child method and calling parentMethod") Parent.parentMethod() } }
But Scala 2.12.4 does not compile this code. I get an error message:
Error: (9, 12) the parentMethod method in the Parent object cannot be accessed in the parent.Parent object Access to the protected parentMethod method is not allowed because the prefix type parent.Parent.type does not match the Child object in the child package where Parent access takes place .parentMethod ()
This access pattern was very important to me because JOOQ code generation uses this.
What happened?
source share