diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 80fab2246726..abc41623e6ac 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -875,7 +875,7 @@ object desugar { val modul = ValDef(moduleName, clsRef, New(clsRef, Nil)) .withMods(mods.toTermFlags & RetainedModuleValFlags | ModuleValCreationFlags) .withSpan(mdef.span.startPos) - .withEndIndex(copyFrom=mdef) + .withEndIndex(copyFrom = mdef) val ValDef(selfName, selfTpt, _) = impl.self val selfMods = impl.self.mods if (!selfTpt.isEmpty) report.error(ObjectMayNotHaveSelfType(mdef), impl.self.srcPos) diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index ec669ada5f71..f44c823efb8d 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -346,7 +346,7 @@ object Trees { self.withAttachment(EndIndex, index) final def withEndIndex(copyFrom: WithEndMarker): self.type = - copyFrom.endIndex.foreach(index => withEndIndex(index)) + copyFrom.endIndex.foreach(withEndIndex) this final def dropEndIndex: self.type = diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 441ef71f22d0..887621468ab7 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1293,12 +1293,12 @@ object Parsers { case _: (ForYield | ForDo) => in.token == FOR case _ => false - def matchesWithUpdated(stat: Tree): Boolean = { + def matchesAndSetEnd(stat: Tree): Boolean = { val didMatch = matches(stat) if didMatch then stat match case stat: WithEndMarker => - stat.withEndIndex(index=in.lastCharOffset) + stat.withEndIndex(index = in.lastCharOffset) case _ => () didMatch @@ -1306,7 +1306,7 @@ object Parsers { if in.token == END then val start = in.skipToken() - if stats.isEmpty || !matchesWithUpdated(stats.last) then + if stats.isEmpty || !matchesAndSetEnd(stats.last) then syntaxError("misaligned end marker", Span(start, in.lastCharOffset)) in.token = IDENTIFIER // Leaving it as the original token can confuse newline insertion in.nextToken()