Skip to content

Commit 25b8b6b

Browse files
committed
rename val and unnecessary atPos
Note that there's no need to explicitly call `atPos` here, because the initializer of `Positioned` will automatically synthesize the initial position from its children elements. Refer to the definition of `Positioned` for more details.
1 parent c7a5ccc commit 25b8b6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,12 +1827,12 @@ object Parsers {
18271827
def defOrDcl(start: Int, mods: Modifiers): Tree = in.token match {
18281828
case VAL =>
18291829
val mod = atPos(in.skipToken()) { Mod.Val() }
1830-
val modPos = atPos(start) { mods.withAddedMod(mod) }
1831-
patDefOrDcl(start, modPos, in.getDocComment(start))
1830+
val mods1 = mods.withAddedMod(mod)
1831+
patDefOrDcl(start, mods1, in.getDocComment(start))
18321832
case VAR =>
18331833
val mod = atPos(in.skipToken()) { Mod.Var() }
1834-
val modPos = atPos(start) { addMod(mods, mod) }
1835-
patDefOrDcl(start, modPos, in.getDocComment(start))
1834+
val mod1 = addMod(mods, mod)
1835+
patDefOrDcl(start, mod1, in.getDocComment(start))
18361836
case DEF =>
18371837
defDefOrDcl(start, posMods(start, mods), in.getDocComment(start))
18381838
case TYPE =>

0 commit comments

Comments
 (0)