Open
Description
Compiler version
3.4.0
Minimized code
object types {
opaque type Test[A] = Unit
object Test {
def derived[A]: Test[A] = ()
}
}
case class Foo() derives types.Test
Output
-- [E170] Type Error: ----------------------------------------------------------
9 |case class Foo() derives types.Test
| ^^^^^^^^^^
| types.Test is not a class type
Expectation
Given the docs on how derives
clauses are desugared, I wouldn't expect it to matter that types.Test
is not a class type. I expected the generated definition to look like this, which compiles if written by hand:
given types.Test[Foo] = types.Test.derived