Skip to content

Commit 93753dc

Browse files
committed
Avoid spurious procedure syntax migration warning
1 parent 0650ec0 commit 93753dc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1736,7 +1736,7 @@ object Parsers {
17361736
in.nextToken()
17371737
val vparamss = paramClauses(nme.CONSTRUCTOR)
17381738
val rhs = {
1739-
if (!scala2ProcedureSyntax || in.token != LBRACE) accept(EQUALS)
1739+
if (!(in.token == LBRACE && scala2ProcedureSyntax)) accept(EQUALS)
17401740
atPos(in.offset) { constrExpr() }
17411741
}
17421742
makeConstructor(Nil, vparamss, rhs).withMods(mods)

tests/pos-special/variances-constr.scala

+6
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ object Test {
1919
}
2020
}
2121

22+
class CC[+A] {
23+
class Inner {
24+
def this(a: A) = this()
25+
}
26+
}
27+

0 commit comments

Comments
 (0)