File tree 2 files changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/parsing
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -817,8 +817,10 @@ object Parsers {
817
817
if enclosingIndent < in.currentRegion.indentWidth then
818
818
in.currentRegion.indentWidth
819
819
else if
820
- in.token == CASE &&
821
- in.currentRegion.indentWidth == in.currentRegion.enclosing.indentWidth
820
+ in.token == CASE && (
821
+ in.currentRegion.enclosing == null ||
822
+ in.currentRegion.indentWidth == in.currentRegion.enclosing.indentWidth
823
+ )
822
824
then enclosingIndent
823
825
else enclosingIndent.increment
824
826
try body
Original file line number Diff line number Diff line change @@ -643,7 +643,8 @@ object Scanners {
643
643
currentRegion.knownWidth = nextWidth
644
644
else if (lastWidth != nextWidth)
645
645
val lw = lastWidth
646
- errorButContinue(spaceTabMismatchMsg(lw, nextWidth))
646
+ val msg = spaceTabMismatchMsg(lw, nextWidth)
647
+ if rewriteToIndent then report.warning(msg) else errorButContinue(msg)
647
648
if token != OUTDENT then
648
649
handleNewIndentWidth(currentRegion, _.otherIndentWidths += nextWidth)
649
650
if next.token == EMPTY then
You can’t perform that action at this time.
0 commit comments