diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index f9fc4158c677..c83882829748 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -528,7 +528,7 @@ object Scanners { case r: Indented => indentIsSignificant = indentSyntax lastWidth = r.width - newlineIsSeparating = lastWidth <= nextWidth + newlineIsSeparating = lastWidth <= nextWidth || r.isOutermost indentPrefix = r.prefix case r: InBraces => indentIsSignificant = indentSyntax diff --git a/tests/pos/i8606.scala b/tests/pos/i8606.scala new file mode 100644 index 000000000000..f1e13da30c36 --- /dev/null +++ b/tests/pos/i8606.scala @@ -0,0 +1,2 @@ + class A {} +@FunctionalInterface class B \ No newline at end of file