Skip to content

Commit 7bc5cd1

Browse files
committed
Merge pull request #132 from DarkDimius/small-fixes
Small fixes
2 parents deea15e + 58bbd56 commit 7bc5cd1

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,10 @@ object Trees {
775775
override def isEmpty: Boolean = trees.isEmpty
776776
override def toList: List[Tree[T]] = flatten(trees)
777777
override def toString = if (isEmpty) "EmptyTree" else "Thicket(" + trees.mkString(", ") + ")"
778+
override def withPos(pos: Position): this.type = {
779+
val newTrees = trees.map(_.withPos(pos))
780+
new Thicket[T](newTrees).asInstanceOf[this.type]
781+
}
778782
}
779783

780784
class EmptyValDef[T >: Untyped] extends ValDef[T](

src/dotty/tools/dotc/core/Phases.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ object Phases {
109109
squashedPhases += block
110110
prevPhases ++= phasess(i).map(_.name)
111111
block.init(this, phasess(i).head.id, phasess(i).last.id)
112-
} else squashedPhases += phasess(i).head
112+
} else {
113+
squashedPhases += phasess(i).head
114+
prevPhases += phasess(i).head.name
115+
}
113116
i += 1
114117
}
115118
(NoPhase :: squashedPhases.toList ::: new TerminalPhase :: Nil).toArray

src/dotty/tools/dotc/transform/CreateCompanionObjects.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ abstract class CreateCompanionObjects extends TreeTransform {
3838
else {
3939
val moduleSymbol = ctx.newCompleteModuleSymbol(claz.symbol.owner, claz.name.toTermName, Flags.Synthetic, Flags.Synthetic, List(defn.ObjectClass.typeRef), Scopes.newScope)
4040
if (moduleSymbol.owner.isClass) moduleSymbol.entered
41-
val companion = tpd.ModuleDef(moduleSymbol, List(EmptyTree))
41+
val companion = tpd.ModuleDef(moduleSymbol, List(EmptyTree)).withPos(claz.pos)
4242
acc += claz
4343
acc += companion
4444
transformStats0(stats, acc)

src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ class LazyValTranformContext {
379379
val state = Select(Ident(helperModule.termRef), LazyVals.Names.state.toTermName)
380380
val cas = Select(Ident(helperModule.termRef), LazyVals.Names.cas.toTermName)
381381

382-
val accessor = mkThreadSafeDef(x.symbol.asTerm, claz, ord, containerSymbol, rhs, x.tpe, offset, getFlag, state, cas, setFlag, wait)
382+
val accessor = mkThreadSafeDef(x.symbol.asTerm, claz, ord, containerSymbol, rhs, tpe, offset, getFlag, state, cas, setFlag, wait)
383383
if(flag eq EmptyTree)
384384
Thicket(List(containerTree, accessor))
385385
else Thicket(List(containerTree, flag, accessor))

0 commit comments

Comments
 (0)