@@ -2213,10 +2213,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
22132213 typedMatchFinish(tree, sel1, selType, tree.cases, pt)
22142214 }
22152215
2216- /** Are some form of brackets necessary to annotate the tree `sel` as `@unchecked `?
2216+ /** Are some form of brackets necessary to annotate the tree `sel` as `.runtimeChecked `?
22172217 * If so, return a Some(opening bracket, closing bracket), otherwise None.
22182218 */
2219- def uncheckedBrackets (sel : untpd.Tree ): Option [(String , String )] = sel match
2219+ def runtimeCheckedBrackets (sel : untpd.Tree ): Option [(String , String )] = sel match
22202220 case _ : untpd.If
22212221 | _ : untpd.Match
22222222 | _ : untpd.ForYield
@@ -2235,20 +2235,20 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
22352235 && sourceVersion.isAtLeast(`3.2`)
22362236 && sourceVersion.isMigrating
22372237 then
2238- if isPatDef then uncheckedBrackets (tree.selector) match
2238+ if isPatDef then runtimeCheckedBrackets (tree.selector) match
22392239 case None =>
2240- patch(Span (tree.selector.span.end), " : @unchecked " )
2240+ patch(Span (tree.selector.span.end), " .runtimeChecked " )
22412241 case Some (bl, br) =>
22422242 patch(Span (tree.selector.span.start), s " $bl" )
2243- patch(Span (tree.selector.span.end), s " $br: @unchecked " )
2243+ patch(Span (tree.selector.span.end), s " $br.runtimeChecked " )
22442244 else
22452245 patch(Span (tree.span.start), " case " )
22462246
22472247 // skip exhaustivity check in later phase
22482248 // TODO: move the check above to patternMatcher phase
2249- val uncheckedTpe = AnnotatedType (sel.tpe.widen, Annotation (defn.UncheckedAnnot , tree.selector.span))
2249+ val runtimeCheckedTpe = AnnotatedType (sel.tpe.widen, Annotation (defn.RuntimeCheckedAnnot , tree.selector.span))
22502250 tpd.cpy.Match (result)(
2251- selector = tpd.Typed (sel, tpd.TypeTree (uncheckedTpe , inferred = true )),
2251+ selector = tpd.Typed (sel, tpd.TypeTree (runtimeCheckedTpe , inferred = true )),
22522252 cases = result.cases
22532253 )
22542254 case _ =>
0 commit comments