Please see union types, if you are using Scala 3
https://docs.scala-lang.org/scala3/book/types-union.html