zio / izumi-reflect

TypeTag without scala-reflect. Supports Scala 2 and Scala 3.
https://zio.dev/izumi-reflect
Other
140 stars 35 forks source link

TagMacro: make HKTag summonable for unapplied type lambdas with type bounds #30

Open neko-kai opened 4 years ago

neko-kai commented 4 years ago

The following should work:

trait X
trait XAble[_ <: X]
class Y extends X

def getTag[F[_ <: X]: Tag.auto.T] = Tag[F[Y]]

getTag[XAble]
// Tag[XAble[Y]]
neko-kai commented 1 year ago

This is already fixed on Scala 3:

type `TagK<:Dep`[K[_ <: Dep]] = Tag.auto.T[K]

def t[T[_ <: Dep]: `TagK<:Dep`, A <: Dep: Tag] = Tag[T[A]]

assert(t[Trait3, Dep].tag == Tag[Trait3[Dep]].tag)

But not fixed on Scala 2.