Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False-positive subtype checking for Scala 3 opaque types #472

Open
kyri-petrou opened this issue Jul 26, 2024 · 1 comment
Open

False-positive subtype checking for Scala 3 opaque types #472

kyri-petrou opened this issue Jul 26, 2024 · 1 comment

Comments

@kyri-petrou
Copy link

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 zio/zio#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
}
@neko-kai
Copy link
Member

Addressed in #468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants