diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 13 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 4 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 9fb36a43ad..e8955a42f1 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -22,6 +22,11 @@ abstract class Mixin extends InfoTransform { /** The phase might set the fiollowing new flags: */ override def phaseNewFlags: long = lateMODULE | notABSTRACT + /** This map contains a binding (class -> info) if + * the class with this info at phase mixinPhase has been treated for mixin composition + */ + private val treatedClassInfos = collection.mutable.Map[Symbol, Type]() + // --------- helper functions ----------------------------------------------- /** A member of a trait is implemented statically if its implementation after the @@ -123,8 +128,8 @@ abstract class Mixin extends InfoTransform { * @param clazz ... */ def addLateInterfaceMembers(clazz: Symbol): unit = - if (!(clazz hasFlag MIXEDIN)) { - clazz setFlag MIXEDIN + if ((treatedClassInfos get clazz) != Some(clazz.info)) { + treatedClassInfos(clazz) = clazz.info assert(phase == currentRun.mixinPhase) /** Create a new getter. Getters are never private or local. They are @@ -174,8 +179,8 @@ abstract class Mixin extends InfoTransform { * - for every module in T, add a module */ def addMixedinMembers(clazz: Symbol): unit = { - if (!(clazz hasFlag MIXEDIN) && (clazz != ObjectClass)) { - clazz setFlag MIXEDIN + if (!(clazz hasFlag JAVA) && (treatedClassInfos get clazz) != Some(clazz.info)) { + treatedClassInfos(clazz) = clazz.info assert(!clazz.isTrait, clazz) assert(!clazz.info.parents.isEmpty, clazz) diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 3a434f3b6c..1f4698c214 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -21,7 +21,7 @@ import scala.tools.nsc.util.Position * - for every argument to a def parameter `x: => T': * if argument is not a reference to a def parameter: * convert argument `e' to (expansion of) `() => e' - * - for every repated parameter `x: T*' --> x: Seq[a]. + * - for every repated parameter `x: T*' --> x: Seq[T]. * - for every argument list that corresponds to a repeated parameter * (a_1, ..., a_n) => (Seq(a_1, ..., a_n)) * - for every argument list that is an escaped sequence @@ -309,7 +309,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { else { val suffix: Tree = args.last match { case Typed(arg, Ident(name)) if name == nme.WILDCARD_STAR.toTypeName => - arg setType seqType(arg.tpe) + arg /*setType seqType(arg.tpe)*/ case _ => mkArrayValue(args.drop(formals.length - 1)) } |