Skip to content

Cannot derive Mirror.SumOf for inherited trait #13935

Closed
@oscar-broman

Description

@oscar-broman

Compiler version

Latest version tested is 3.1.2-RC1-bin-20211102-82172ed-NIGHTLY

Minimized code

import scala.deriving.Mirror
// Works:
sealed trait HasFoo { sealed trait Foo; case object B extends Foo; summon[Mirror.SumOf[Foo]] }

// Doesn't work:
final class UsesFoo extends HasFoo { summon[Mirror.SumOf[Foo]] }

Output

no implicit argument of type deriving.Mirror.SumOf[UsesFoo.this.Foo] was found for parameter x of method summon in object Predef

Expectation

It should derive the mirror just fine.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions