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

TagMacro: resolve parameters inside type bounds & wildcards #31

Open
neko-kai opened this issue May 10, 2020 · 3 comments
Open

TagMacro: resolve parameters inside type bounds & wildcards #31

neko-kai opened this issue May 10, 2020 · 3 comments
Assignees
Labels
💎 Bounty enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@neko-kai
Copy link
Member

neko-kai commented May 10, 2020

Replace parameters in type bounds _ >: G <: T, i.e. the following should substitute T with Int correctly:

https://scastie.scala-lang.org/O21OwKIRQ0eMdoUqkvo1fQ

import izumi.reflect.Tag

def getUpperBoundTag[T: Tag] = Tag[Set[_ <: T]]
def getLowerBoundTag[T: Tag] = Tag[Set[_ >: T]]

println(getUpperBoundTag[Int].tag)
// right now it's Set[=Int], should be Set[=?: <Nothing..Int>]

println(getLowerBoundTag[Int].tag)
// right now it's Set[=?: <T..Any>], should be Set[=?: <Int..Any>]
@jdegoes
Copy link
Member

jdegoes commented Nov 8, 2024

/bounty $150

Copy link

algora-pbc bot commented Nov 8, 2024

💎 $150 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #31 with your implementation plan
  2. Submit work: Create a pull request including /claim #31 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

@pshirshov
Copy link
Member

A couple of notes for the potential collaborator:

  • Our model already can express wildcards with type boundaries, see LightTypeTagRef#WildcardReference
  • The scope of this issue is limited to extending the macro extractors (both Scala 2 and Scala 3) to preserve more information for wildcards
  • TagMacro should also be improved to allow correct type parameter substitution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants