Skip to content

Commit e67ff61

Browse files
authored
Merge pull request #2380 from dotty-staging/fix-@2379
Fix #2379: Deprecate `with` in types only under -strict
2 parents ad2bb89 + b15ba90 commit e67ff61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,8 @@ object Parsers {
763763

764764
def withTypeRest(t: Tree): Tree =
765765
if (in.token == WITH) {
766-
deprecationWarning(DeprecatedWithOperator())
766+
if (ctx.settings.strict.value)
767+
deprecationWarning(DeprecatedWithOperator())
767768
in.nextToken()
768769
AndTypeTree(t, withType())
769770
}

0 commit comments

Comments
 (0)