@@ -43,29 +43,18 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
4343 * methods in the impl class (because they can have arbitrary initializers)
4444 */
4545 private def isImplementedStatically (sym : Symbol ) = (
46- erasure.isInterfaceMember( sym)
47- && erasure.needsImplMethod( sym)
46+ sym.isMethod
47+ && ( ! sym.hasFlag( DEFERRED | SUPERACCESSOR ) || ( sym hasFlag lateDEFERRED) )
4848 && sym.owner.isTrait
4949 && sym.isMethod
5050 && (! sym.isModule || sym.hasFlag(PRIVATE | LIFTED ))
5151 && (! (sym hasFlag (ACCESSOR | SUPERACCESSOR )) || sym.isLazy)
52+ && ! sym.isPrivate
53+ && ! sym.hasAllFlags(LIFTED | MODULE | METHOD )
54+ && ! sym.isConstructor
55+ && (! sym.hasFlag(notPRIVATE | LIFTED ) || sym.hasFlag(ACCESSOR | SUPERACCESSOR | MODULE ))
5256 )
5357
54- /** A member of a trait is static only if it belongs only to the
55- * implementation class, not the interface, and it is implemented
56- * statically.
57- */
58- private def isStaticOnly (sym : Symbol ) =
59- isImplementedStatically(sym) && sym.isImplOnly
60-
61- /** A member of a trait is forwarded if it is implemented statically and it
62- * is also visible in the trait's interface. In that case, a forwarder to
63- * the member's static implementation will be added to the class that
64- * inherits the trait.
65- */
66- private def isForwarded (sym : Symbol ) =
67- isImplementedStatically(sym) && ! sym.isImplOnly
68-
6958 private def isFieldWithBitmap (field : Symbol ) = {
7059 field.info // ensure that nested objects are transformed
7160 // For checkinit consider normal value getters
@@ -247,7 +236,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
247236
248237 /* Mix in members of implementation class mixinClass into class clazz */
249238 def mixinTraitForwarders (mixinClass : Symbol ) {
250- for (member <- mixinClass.info.decls ; if isForwarded (member)) {
239+ for (member <- mixinClass.info.decls ; if isImplementedStatically (member)) {
251240 member overridingSymbol clazz match {
252241 case NoSymbol =>
253242 if (clazz.info.findMember(member.name, 0 , 0L , stableOnly = false ).alternatives contains member)
@@ -484,7 +473,8 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
484473 * - A super accessor for every super accessor in a mixin class
485474 * - Forwarders for all methods that are implemented statically
486475 * All superaccessors are completed with right-hand sides (@see completeSuperAccessor)
487- * @param clazz The class to which definitions are added
476+ *
477+ * @param clazz The class to which definitions are added
488478 */
489479 private def addNewDefs (clazz : Symbol , stats : List [Tree ]): List [Tree ] = {
490480 val newDefs = mutable.ListBuffer [Tree ]()
0 commit comments