File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,10 @@ class NonLocalReturns extends MiniPhase {
8989
9090 override def transformReturn (tree : Return )(using Context ): Tree =
9191 if isNonLocalReturn(tree) then
92- if sourceVersion.isAtLeast(future) then
93- report.errorOrMigrationWarning(" Non local returns are no longer supported; use scala.util.control.NonLocalReturns instead" , tree.srcPos)
92+ report.errorOrMigrationWarning(
93+ " Non local returns are no longer supported; use scala.util.control.NonLocalReturns instead" ,
94+ tree.srcPos,
95+ from = future)
9496 nonLocalReturnThrow(tree.expr, tree.from.symbol).withSpan(tree.span)
9597 else tree
9698}
Original file line number Diff line number Diff line change @@ -2472,8 +2472,11 @@ class Typer extends Namer
24722472 def remedy =
24732473 if ((prefix ++ suffix).isEmpty) " simply leave out the trailing ` _`"
24742474 else s " use ` $prefix<function> $suffix` instead "
2475- report.errorOrMigrationWarning(i """ The syntax `<function> _` is no longer supported;
2476- |you can $remedy""" , tree.srcPos, future)
2475+ report.errorOrMigrationWarning(
2476+ i """ The syntax `<function> _` is no longer supported;
2477+ |you can $remedy""" ,
2478+ tree.srcPos,
2479+ from = future)
24772480 if sourceVersion.isMigrating then
24782481 patch(Span (tree.span.start), prefix)
24792482 patch(Span (qual.span.end, tree.span.end), suffix)
You can’t perform that action at this time.
0 commit comments