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
When a method is defined in a trait (i.e. TraitWithMethod), and that trait is mixed into an object (i.e. MethodFromTrait:
trait TraitWithMethod {
def theMethod(): Int = 42
}
case object MethodFromTrait extends TraitWithMethod {
def foo(): Unit = ???
}
Then this should lead to 3 class files: the trait is converted to an interface declaring the method:
public interface TraitWithMethod {
public static int theMethod$(TraitWithMethod);
public int theMethod();
public static void $init$(TraitWithMethod);
}
The MethodFromTrait$ class that implements the interface and contains the method implementation:
public final class MethodFromTrait$ implements TraitWithMethod {
public static MethodFromTrait$ MODULE$;
public static {};
public int theMethod();
public void foo();
}
And a MethodFromTrait class with static forwarders:
public final class MethodFromTrait$ implements TraitWithMethod {
public static MethodFromTrait$ MODULE$;
public static {};
public int theMethod();
public void foo();
}
Currently, genjavadoc does not generate the method on MethodFromTrait$, because genjavadoc runs after the fields compiler stage, and the method is generated later in the mixin stage.
We could fix this by either running genjavadoc after a later compiler stage (but this potentially means undoing a lot of the work in those phases, or simulating the mixin stage logic in genjavadoc.
The text was updated successfully, but these errors were encountered:
When a method is defined in a trait (i.e.
TraitWithMethod
), and that trait is mixed into an object (i.e.MethodFromTrait
:Then this should lead to 3 class files: the trait is converted to an interface declaring the method:
The
MethodFromTrait$
class that implements the interface and contains the method implementation:And a
MethodFromTrait
class with static forwarders:Currently, genjavadoc does not generate the method on
MethodFromTrait$
, because genjavadoc runs after thefields
compiler stage, and the method is generated later in themixin
stage.We could fix this by either running genjavadoc after a later compiler stage (but this potentially means undoing a lot of the work in those phases, or simulating the
mixin
stage logic in genjavadoc.The text was updated successfully, but these errors were encountered: