diff --git a/src/core/xylophone.Xml.scala b/src/core/xylophone.Xml.scala index a8731d0..9a01b6a 100644 --- a/src/core/xylophone.Xml.scala +++ b/src/core/xylophone.Xml.scala @@ -48,7 +48,7 @@ object Xml: def print(xml: Xml)(using XmlPrinter[Text]): Text = summon[XmlPrinter[Text]].print(xml) def pathString(path: XmlPath): Text = if path.isEmpty then t"/" else path.map: value => - (value: @unchecked) match + value.runtimeChecked match case idx: Int => t"[$idx]" case label: Text => t"/$label" case unit: Unit => t"/*" @@ -111,7 +111,7 @@ object Xml: case elem@XmlAst.Element(_, _, _, _) => XmlDoc(XmlAst.Root(elem)) def normalize(xml: Xml): List[XmlAst] raises XmlAccessError = - def recur(path: XmlPath, current: List[XmlAst]): List[XmlAst] = (path: @unchecked) match + def recur(path: XmlPath, current: List[XmlAst]): List[XmlAst] = path.runtimeChecked match case Nil => current diff --git a/src/core/xylophone.XmlDecoder.scala b/src/core/xylophone.XmlDecoder.scala index 1f57c9b..2859294 100644 --- a/src/core/xylophone.XmlDecoder.scala +++ b/src/core/xylophone.XmlDecoder.scala @@ -32,7 +32,7 @@ object XmlDecoder extends Derivation[XmlDecoder]: if elements.length == 0 then raise(XmlReadError(), "".tt) else elements.head given [ValueType](using decoder: Decoder[ValueType]): XmlDecoder[ValueType] = value => - (value: @unchecked) match + value.runtimeChecked match case XmlAst.Element(_, XmlAst.Textual(text) :: _, _, _) +: _ => text.decode[ValueType] inline def join[DerivationType <: Product: ProductReflection]: XmlDecoder[DerivationType] = list => @@ -50,7 +50,7 @@ object XmlDecoder extends Derivation[XmlDecoder]: context.read(List(element)) inline def split[DerivationType: SumReflection]: XmlDecoder[DerivationType] = list => - (list.head: @unchecked) match + list.head.runtimeChecked match case XmlAst.Element(_, children, attributes, _) => delegate(attributes.get(XmlName("type".tt)).get): [VariantType <: DerivationType] => decoder =>