Skip to content

Commit 42cffa3

Browse files
committed
Make boundary.apply a regular inline
Drop the `transparent` in order to curcumvent #16609
1 parent c33cf4d commit 42cffa3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/DropBreaks.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class DropBreaks extends MiniPhase:
9090
*
9191
* { val local: Label[...] = ...; <LabelTry(local, body)> }
9292
*/
93-
def unapply(tree: Tree)(using Context): Option[(Symbol, Tree)] = tree match
93+
def unapply(tree: Tree)(using Context): Option[(Symbol, Tree)] = stripTyped(tree) match
9494
case Block((vd @ ValDef(nme.local, _, _)) :: Nil, LabelTry(caughtAndRhs))
9595
if vd.symbol.info.isRef(defn.LabelClass) && vd.symbol == caughtAndRhs._1 =>
9696
Some(caughtAndRhs)

library/src/scala/util/boundary.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object boundary:
3030
* breaks associated with that label and return their results instead of
3131
* `body`'s result.
3232
*/
33-
transparent inline def apply[T <: R, R](inline body: Label[T] ?=> R): R =
33+
inline def apply[T <: R, R](inline body: Label[T] ?=> R): R =
3434
val local = Label[T]()
3535
try body(using local)
3636
catch case ex: Break[T] @unchecked =>

0 commit comments

Comments
 (0)