Custom AnyVal types in Scala 3 / Dotty

I answered similar questions in Synthesize constructor for opaque types