We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4025951 commit 5a3aed1Copy full SHA for 5a3aed1
compiler/src/dotty/tools/dotc/transform/LiftTry.scala
@@ -44,6 +44,9 @@ class LiftTry extends MiniPhase with IdentityDenotTransformer { thisPhase =>
44
override def prepareForApply(tree: Apply)(using Context): Context =
45
liftingCtx(true)
46
47
+ override def prepareForDefDef(tree: DefDef)(using Context): Context =
48
+ liftingCtx(false)
49
+
50
override def prepareForValDef(tree: ValDef)(using Context): Context =
51
if !tree.symbol.exists
52
|| tree.symbol.isSelfSym
tests/pos/i13941.scala
@@ -0,0 +1,15 @@
1
+import scala.annotation.tailrec
2
3
+object A {
4
+ def b = Option("a").map { x =>
5
+ @tailrec
6
+ def loop(): Int = {
7
+ try
8
+ 2
9
+ catch
10
+ case _: Throwable =>
11
+ loop()
12
+ }
13
+ x
14
15
+}
0 commit comments