shadaj/slinky

Tag support for Scala 3

steinybot opened this issue · 1 comments

This issue is for doing something about T#tagType which is not supported in Scala 3, as mentioned in #494.

  type supports[T <: Tag] = AttrPair[attrType] => AttrPair[T#tagType]

Changing that to something like:

type supports[T <: Tag] = Conversion[AttrPair[attrType], AttrPair[T]]

could be an option but then there is the question of what to do about:

@inline def :=[T <: slinky.core.TagElement](v: slinky.web.SyntheticMouseEvent[T#RefType] => Unit) =
  new slinky.core.AttrPair[T]("onClick", v)

It would probably require an explicit type to be given for the handler which would suck but maybe this could work:

@inline def :=[T <: slinky.core.Tag, R](v: slinky.web.SyntheticMouseEvent[R] => Unit) =
  new slinky.core.AttrPair[T]("onClick", v)

This then begs the question, should AttrPair (and TagMod) keep the A phantom type? I'm not so sure.

Perhaps there is a better way to represent which attributes a tag supports.