MixinOps
Attributes
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Is sym a member of implementing class cls? The test is performed at phase thisPhase.
Is sym a member of implementing class cls? The test is performed at phase thisPhase.
Attributes
meth needs a forwarder in class cls if
meth needs a forwarder in class cls if
-
A non-trait base class defines matching method. Example: class C {def f: Int}; trait T extends C {def f = 1}; class D extends T Even if C.f is abstract, the forwarder in D is needed, otherwise the JVM would resolve
D.ftoC.f, see jvms-6.5.invokevirtual. -
There exists another concrete, matching method in any of the base classes, and the
mixinClassdoes not itself extend that base class. In this case the forwarder is needed to disambiguate. Example: trait T1 {def f = 1}; trait T2 extends T1 {override def f = 2}; class C extends T2 In C we don't need a forwarder for f because T2 extends T1, so the JVM resolves C.f to T2.f non-ambiguously. See jvms-5.4.3.3, "maximally-specific method". trait U1 {def f = 1}; trait U2 {self:U1 => override def f = 2}; class D extends U2 In D the forwarder is needed, the interfaces U1 and U2 are unrelated at the JVM level.