@@ -553,7 +553,7 @@ object Scanners {
553553
554554 // If nextWidth is an indentation level not yet seen by enclosing indentation
555555 // region, invoke `handler`.
556- def handleNewIndentWidth (r : Region , handler : Indented => Unit ): Unit = r match
556+ inline def handleNewIndentWidth (r : Region , inline handler : Indented => Unit ): Unit = r match
557557 case r @ Indented (curWidth, prefix, outer)
558558 if curWidth < nextWidth && ! r.otherIndentWidths.contains(nextWidth) && nextWidth != lastWidth =>
559559 handler(r)
@@ -571,7 +571,7 @@ object Scanners {
571571 * they start with `(`, `[` or `{`, or the last statement ends in a `return`.
572572 * The Scala 2 rules apply under source `3.0-migration` or under `-no-indent`.
573573 */
574- def isContinuing =
574+ inline def isContinuing =
575575 lastWidth < nextWidth
576576 && (openParensTokens.contains(token) || lastToken == RETURN )
577577 && ! pastBlankLine
@@ -608,10 +608,11 @@ object Scanners {
608608 case r : Indented =>
609609 insert(OUTDENT , offset)
610610 handleNewIndentWidth(r.enclosing, ir =>
611+ val lw = lastWidth
611612 errorButContinue(
612613 em """ The start of this line does not match any of the previous indentation widths.
613614 |Indentation width of current line : $nextWidth
614- |This falls between previous widths: ${ir.width} and $lastWidth """ ))
615+ |This falls between previous widths: ${ir.width} and $lw """ ))
615616 case r =>
616617 if skipping then
617618 if r.enclosing.isClosedByUndentAt(nextWidth) then
@@ -627,7 +628,8 @@ object Scanners {
627628 else if lastToken == SELFARROW then
628629 currentRegion.knownWidth = nextWidth
629630 else if (lastWidth != nextWidth)
630- errorButContinue(spaceTabMismatchMsg(lastWidth, nextWidth))
631+ val lw = lastWidth
632+ errorButContinue(spaceTabMismatchMsg(lw, nextWidth))
631633 if token != OUTDENT then
632634 handleNewIndentWidth(currentRegion, _.otherIndentWidths += nextWidth)
633635 if next.token == EMPTY then
0 commit comments