Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't summon Mirror for a sealed trait containing another sealed trait #12308

Closed
ghostdogpr opened this issue May 2, 2021 · 2 comments
Closed

Comments

@ghostdogpr
Copy link
Contributor

Compiler version

3.0.0-RC3

Minimized code

import scala.deriving.Mirror
import scala.compiletime._

sealed trait SomeTrait
object SomeTrait {
  case class B(a: Int) extends SomeTrait
  case class C(a: Int) extends SomeTrait
  sealed trait SomeOtherTrait extends SomeTrait
  case class D(a: Int) extends SomeOtherTrait
}

summonInline[Mirror.Of[SomeTrait]]

Output

cannot reduce summonFrom with
 patterns :  case given t @ _:deriving.Mirror.Of[SomeTrait]

Expectation

A mirror is summoned.

I am currently trying to cross-build a library with Scala 3 and rewriting the typeclass derivation logic. I ran into this issue when dealing with nested sealed traits. Is that intended? Is there any workaround?

@odersky
Copy link
Contributor

odersky commented May 3, 2021

That's not supported yet. See #11686

@dwijnand
Copy link
Member

dwijnand commented May 4, 2021

Duplicate of lampepfl/dotty-feature-requests#161.

@dwijnand dwijnand closed this as completed May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants