This usecase is heavily desirable. case in point: shapeless.tag creates subtypes, not newtypes. There are other special tagging libraries focused on subtypes: refined, softwaremill/commons, scala-supertagged, squants, terminology. - I dare say this is the usecase that makes people turn to tagging - AnyVals do a reasonable job at newtypes already, going from an AnyVal to tagged type is just an optimization at the cost of obscurity and is generally not performed. Where you do see tagged types in real world code they’re usually subtypes, not newtypes. Without supporting subtyping opaque types would fail to do their job - transforming the widely used hacks-turned-patterns into an accessible and teachable idiomatic language feature.
2 Likes