diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 7d69a7c7b..ce92ecec9 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -1030,7 +1030,12 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { val specMembers = makeSpecializedMembers(tree.symbol.enclClass) ::: (implSpecClasses(body) map localTyper.typed) if (!symbol.isPackageClass) (new CollectMethodBodies)(tree) - treeCopy.Template(tree, currentOwner.info.parents.map(TypeTree), self, + val parents1 = currentOwner.info.parents.zipWithIndex.map { + case (tpe, idx) => TypeTree(tpe) setPos parents(idx).pos + } + treeCopy.Template(tree, + parents1 /*currentOwner.info.parents.map(tpe => TypeTree(tpe) setPos parents.head.pos)*/, + self, atOwner(currentOwner)(transformTrees(body ::: specMembers))) case ddef @ DefDef(mods, name, tparams, vparamss, tpt, rhs) if info.isDefinedAt(symbol) => @@ -1122,8 +1127,9 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { symbol.enclClass, typeEnv(symbol.alias) ++ typeEnv(tree.symbol)) - case Apply(Select(Super(qual, name), name1), args) => - val res = localTyper.typed(atPos(tree.pos)(Apply(Select(Super(qual, name), name1), args))) + case Apply(sel @ Select(sup @ Super(qual, name), name1), args) => + val res = localTyper.typed( + Apply(Select(Super(qual, name) setPos sup.pos, name1) setPos sel.pos, args) setPos tree.pos) log("retyping call to super, from: " + symbol + " to " + res.symbol) res @@ -1296,8 +1302,8 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { for (((sym1, env), specCls) <- specializedClass if sym1 == tree.symbol) { val parents = specCls.info.parents.map(TypeTree) buf += - ClassDef(specCls, Template(parents, emptyValDef, List()) - .setSymbol(specCls.newLocalDummy(sym1.pos))) + ClassDef(specCls, atPos(impl.pos)(Template(parents, emptyValDef, List())) + .setSymbol(specCls.newLocalDummy(sym1.pos))) setPos tree.pos log("created synthetic class: " + specCls + " of " + sym1 + " in env: " + env) } case _ => diff --git a/test/files/buildmanager/t2652/t2652.check b/test/files/buildmanager/t2652/t2652.check index 77a27a727..0e685c1f9 100644 --- a/test/files/buildmanager/t2652/t2652.check +++ b/test/files/buildmanager/t2652/t2652.check @@ -3,7 +3,7 @@ compiling Set(A.scala, B.scala) Changes: Map() builder > A.scala compiling Set(A.scala) -Changes: Map(class A -> List(Changed(Definition(A.x))[method x changed from [T](t: T)T to [T](t: T)T flags: ])) +Changes: Map(class A -> List(Added(Definition(A.x$mBc$sp)), Added(Definition(A.x$mCc$sp)), Added(Definition(A.x$mDc$sp)), Added(Definition(A.x$mFc$sp)), Added(Definition(A.x$mIc$sp)), Added(Definition(A.x$mLc$sp)), Added(Definition(A.x$mSc$sp)), Added(Definition(A.x$mVc$sp)), Added(Definition(A.x$mZc$sp)), Changed(Definition(A.x))[method x changed from [T](t: T)T to [T](t: T)T flags: ])) invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from [T](t: T)T to [T](t: T)T flags: ]] compiling Set(B.scala) Changes: Map(object B -> List())