Closed joroKr21 closed 6 years ago
Here is another motivation for adding NewSubType support to macro:I found that NewSubType works better with shapeless. (i.e. when deriving things using shapeless, case classes with field of NewType type has some kinkiness, while NewSubType seems just working fine. )
A couple of ideas for how this would look -
@newtype(subtype = true) class Foo(x: Int)
@newtype.sub class Foo(x: Int)
@newsubtype class Foo(x: Int)
I'm not particularly happy with any of them, so if anyone has a better idea for the syntax, feel free to suggest it.
My preference isn't very strong but here it is . 3 > 1 > 2
This has been merged to master as @newsubtype
, which will be available in the 0.4.0 release.
This is only possible with
NewSubType
but I think it's still useful.