Skip to content

Add support for the Newtype library #56

@gvolpe

Description

@gvolpe

It seems the @newtype annotation from the scala-newtype library doesn't work well with the @derive annotation.

This fails to compile:

@newtype
@derive(show)
case class Foo(value: String)

@newtype
@derive(show)
case class Bar(value: Int)

@derive(show)
final case class Ctx(foo: Foo, bar: Bar)

Here's the error:

[error] /examples/foo.scala:19:4: magnolia: could not find Show.Typeclass for type examples..Foo
[error]     in parameter 'foo' of product type examples.Ctx
[error]   @derive(show)
[error]    ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed

Maybe worth looking into scalaz-deriving that has support for it.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions