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 · 8 comments
Open

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

kyri-petrou opened this issue Jul 26, 2024 · 8 comments
Labels
💎 Bounty bug Something isn't working 💰 Rewarded

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

@jdegoes
Copy link
Member

jdegoes commented Nov 8, 2024

/bounty $250

Copy link

algora-pbc bot commented Nov 8, 2024

💎 $250 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #472 with your implementation plan
  2. Submit work: Create a pull request including /claim #472 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/izumi-reflect!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @neko-kai #468

Copy link

algora-pbc bot commented Nov 8, 2024

💡 @neko-kai submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Copy link

algora-pbc bot commented Nov 8, 2024

🎉🎈 @neko-kai has been awarded $250! 🎈🎊

@neko-kai
Copy link
Member

neko-kai commented Nov 8, 2024

@jdegoes Maybe you made a mistake opening the bounty on this issue since the solution was already pending? I can refund the bounty back, although I don't mind either way.

@jdegoes
Copy link
Member

jdegoes commented Nov 8, 2024

@neko-kai Keep it, you earned it!

@jdegoes jdegoes closed this as completed Nov 8, 2024
@neko-kai neko-kai reopened this Nov 8, 2024
@neko-kai
Copy link
Member

neko-kai commented Nov 8, 2024

This still needs to be released

@pshirshov pshirshov added the bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty bug Something isn't working 💰 Rewarded
Projects
None yet
Development

No branches or pull requests

4 participants