Skip to content

Commit fbc8077

Browse files
committed
Make Label a final class
1 parent 8fb3c38 commit fbc8077

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class DropBreaks extends MiniPhase, RecordStackChange:
123123
Some((id.symbol, arg))
124124
case _ => None
125125
case _ => None
126+
end Break
126127

127128
/** The LabelUsage data associated with `lbl` in the current context */
128129
private def labelUsage(lbl: Symbol)(using Context): Option[LabelUsage] =

library/src/scala/util/boundary.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ object boundary:
2323

2424
/** Labels are targets indicating which boundary will be exited by a `break`.
2525
*/
26-
class Label[-T]:
26+
final class Label[-T]:
2727
def break(value: T): Nothing = throw Break(this, value)
2828

2929
/** Run `body` with freshly generated label as implicit argument. Catch any

0 commit comments

Comments
 (0)