Skip to content

Commit 119e3d7

Browse files
authored
Merge pull request #14959 from dotty-staging/fix-11712
Accept soft modifiers separated by blank lines
2 parents 1fdabad + eb1e71f commit 119e3d7

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2873,7 +2873,7 @@ object Parsers {
28732873
val isAccessMod = accessModifierTokens contains in.token
28742874
val mods1 = addModifier(mods)
28752875
loop(if (isAccessMod) accessQualifierOpt(mods1) else mods1)
2876-
else if (in.token == NEWLINE && (mods.hasFlags || mods.hasAnnotations)) {
2876+
else if (in.isNewLine && (mods.hasFlags || mods.hasAnnotations)) {
28772877
in.nextToken()
28782878
loop(mods)
28792879
}

library/src/scala/quoted/Expr.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package scala.quoted
44
*
55
* `Expr` has extension methods that are defined in `scala.quoted.Quotes`.
66
*/
7-
abstract class Expr[+T] private[scala]
7+
abstract class Expr[+T] private[scala] ()
88

99
/** Constructors for expressions */
1010
object Expr {

tests/pos/i11712.scala

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
object Test:
2+
3+
def transparent = println("transparent method called")
4+
5+
transparent
6+
println()
7+
inline def f1 = 1
8+
9+
transparent
10+
inline def f2 = 2
11+
12+
transparent
13+
trait T1
14+
15+
transparent
16+
17+
inline def f3 = 3
18+
19+
transparent
20+
21+
trait T2

0 commit comments

Comments
 (0)