Skip to content

Commit 57ee82c

Browse files
authored
Merge pull request #2722 from dotty-staging/enum-pos
Fix positions of enum cases
2 parents c77213e + 9c03aad commit 57ee82c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ object DesugarEnums {
161161
val (tagMeth, scaffolding) = enumTagMeth(CaseKind.Object)
162162
val impl1 = cpy.Template(impl)(body =
163163
impl.body ++ List(tagMeth, toStringMeth) ++ registerCall)
164-
val vdef = ValDef(name, TypeTree(), New(impl1)).withMods(mods | Final).withPos(pos)
165-
flatTree(scaffolding ::: vdef :: Nil).withPos(pos.startPos)
164+
val vdef = ValDef(name, TypeTree(), New(impl1)).withMods(mods | Final)
165+
flatTree(scaffolding ::: vdef :: Nil).withPos(pos)
166166
}
167167

168168
/** Expand a simple enum case */
@@ -175,7 +175,7 @@ object DesugarEnums {
175175
else {
176176
val (tag, scaffolding) = nextEnumTag(CaseKind.Simple)
177177
val creator = Apply(Ident(nme.DOLLAR_NEW), List(Literal(Constant(tag)), Literal(Constant(name.toString))))
178-
val vdef = ValDef(name, enumClassRef, creator).withMods(mods | Final).withPos(pos)
179-
flatTree(scaffolding ::: vdef :: Nil).withPos(pos.startPos)
178+
val vdef = ValDef(name, enumClassRef, creator).withMods(mods | Final)
179+
flatTree(scaffolding ::: vdef :: Nil).withPos(pos)
180180
}
181181
}

0 commit comments

Comments
 (0)