For some reason, when 2 Scala 3 opaque types have the same underlying type, the subtype check <:< seems to falsely return true. AFAICT, this seems to be what's causing https://github.com/zio/zio/issues/8882 (albeit there might be more to it, but first things first 😅)
Repro:
import izumi.reflect.Tag
type UserName = UserName.T
object UserName {
opaque type T = String
}
type UserId = UserId.T
object UserId {
opaque type T = String
}
val idTag = Tag[UserId]
val nameTag = Tag[UserName]
@main def m = {
assert(!(idTag =:= nameTag), "idTag =:= nameTag") // passes
assert(!(idTag <:< nameTag), "idTag <:< nameTag") // fails
}
For some reason, when 2 Scala 3 opaque types have the same underlying type, the subtype check
<:<
seems to falsely returntrue
. AFAICT, this seems to be what's causing https://github.com/zio/zio/issues/8882 (albeit there might be more to it, but first things first 😅)Repro: