File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1280,13 +1280,14 @@ object Parsers {
12801280
12811281 def argumentStart (): Unit =
12821282 colonAtEOLOpt()
1283- if in.isScala2CompatMode && in.token == NEWLINE && in.next.token == LBRACE then
1283+ if migrateTo3 && in.token == NEWLINE && in.next.token == LBRACE then
12841284 in.nextToken()
12851285 if in.indentWidth(in.offset) == in.currentRegion.indentWidth then
1286- in .errorOrMigrationWarning(
1286+ ctx .errorOrMigrationWarning(
12871287 i """ This opening brace will start a new statement in Scala 3.
12881288 |It needs to be indented to the right to keep being treated as
1289- |an argument to the previous expression. ${rewriteNotice()}""" )
1289+ |an argument to the previous expression. ${rewriteNotice()}""" ,
1290+ in.sourcePos())
12901291 patch(source, Span (in.offset), " " )
12911292
12921293 def possibleTemplateStart (isNew : Boolean = false ): Unit =
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ object Scanners {
438438 def isContinuingParens () =
439439 openParensTokens.contains(token)
440440 && ! pastBlankLine
441- && ! isScala2CompatMode
441+ && ! migrateTo3
442442 && ! noindentSyntax
443443
444444 /** The indentation width of the given offset */
Original file line number Diff line number Diff line change @@ -14,3 +14,10 @@ def f: Int => Int =
1414 { (x : Int ) =>
1515 x + 1
1616 }
17+
18+ val x =
19+ true && // newline inserted here but skipped because of trailing &&
20+ {
21+ val xyz = true
22+ xyz && false
23+ }
You can’t perform that action at this time.
0 commit comments