Skip to content

Commit df66810

Browse files
committed
Fixing positions not being set in CreateCompanionObjects
See discussion in scala#128
1 parent e83df26 commit df66810

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)

0 commit comments

Comments
 (0)