Skip to content

Commit 7d53118

Browse files
committed
Piggy back tweak in parser
(unrelated to PR, but it's too much hassle to open a separate one to get this in)
1 parent 45e2e06 commit 7d53118

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,13 +1144,12 @@ object Parsers {
11441144
val name = bindingName()
11451145
val t =
11461146
if (in.token == COLON && location == Location.InBlock) {
1147-
if (false) // Don't error yet, as the alternative syntax "implicit (x: T) => ... "
1148-
// is not supported by Scala2.x
1147+
if (ctx.settings.strict.value)
1148+
// Don't error in non-strict mode, as the alternative syntax "implicit (x: T) => ... "
1149+
// is not supported by Scala2.x
11491150
migrationWarningOrError(s"This syntax is no longer supported; parameter needs to be enclosed in (...)")
1150-
11511151
in.nextToken()
11521152
val t = infixType()
1153-
11541153
if (false && in.isScala2Mode) {
11551154
patch(source, Position(start), "(")
11561155
patch(source, Position(in.lastOffset), ")")

0 commit comments

Comments
 (0)