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 {
89
89
90
90
override def transformReturn (tree : Return )(using Context ): Tree =
91
91
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)
94
96
nonLocalReturnThrow(tree.expr, tree.from.symbol).withSpan(tree.span)
95
97
else tree
96
98
}
Original file line number Diff line number Diff line change @@ -2472,8 +2472,11 @@ class Typer extends Namer
2472
2472
def remedy =
2473
2473
if ((prefix ++ suffix).isEmpty) " simply leave out the trailing ` _`"
2474
2474
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)
2477
2480
if sourceVersion.isMigrating then
2478
2481
patch(Span (tree.span.start), prefix)
2479
2482
patch(Span (qual.span.end, tree.span.end), suffix)
You can’t perform that action at this time.
0 commit comments