Skip to content

Releases: rudogma/scala-supertagged

Big changes. See README

13 Feb 07:55
Compare
Choose a tag to compare
2.0-RC1

Uncomment `supertaggedNative` (or Idea fails to import changes)

2.13 Support

12 Feb 19:55
Compare
Choose a tag to compare
1.5

Bump sbt and plugins versions

Changed TaggedTypeF implementation

20 Nov 10:19
Compare
Choose a tag to compare

Previous implementation was wrong.

Before:

def Width[T] = TaggedTypeF[T]
type Width[T] = TaggedTypeF[T]#Type

def Height[T] = TaggedTypeF[T]
type Height[T] = TaggedTypeF[T]#Type

val w = Width[Int](5)
val h = Height[Int](5)

// this function will accept both  @w && @h

onlyWidthOfInt(w) // compiles ok
onlyWidthOfInt(h) // compiles ok, wrong behaviour

def onlyWidthOfInt(width:Width[Int]):Unit = {}

Now

object Width extends TaggedTypeF
type Width[T] = Width.Type[T]

object Height extends TaggedTypeF
type Height[T] = Height.Type[T]

val w = Width[Int](5)
val h = Height[Int](5)

onlyWidthOfInt(w) // compiles ok
onlyWidthOfInt(h) // compiles fail, right behaviour

def onlyWidthOfInt(width:Width[Int]):Unit = {}