-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:implicitsrelated to implicitsrelated to implicitsarea:opaque-typesarea:typeclass-derivationitype:language enhancementneeds-sipA SIP needs to be raised to move this issue/PR along.A SIP needs to be raised to move this issue/PR along.
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
joan38 and kubukoz
Metadata
Metadata
Assignees
Labels
area:implicitsrelated to implicitsrelated to implicitsarea:opaque-typesarea:typeclass-derivationitype:language enhancementneeds-sipA SIP needs to be raised to move this issue/PR along.A SIP needs to be raised to move this issue/PR along.