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

Mirror.SumOf not being provided when a direct subtype is also a sum #11765

Closed
japgolly opened this issue Mar 16, 2021 · 2 comments
Closed

Mirror.SumOf not being provided when a direct subtype is also a sum #11765

japgolly opened this issue Mar 16, 2021 · 2 comments

Comments

@japgolly
Copy link
Contributor

Compiler version

3.0.0-RC1

Minimized code

import scala.deriving.*

sealed trait A
sealed trait B extends A
case class A1() extends A
case class B1() extends B

def test =
  summon[Mirror.Of[A]]
  summon[Mirror.Of[B]]
  summon[Mirror.Of[A1]]
  summon[Mirror.Of[B1]]

Output

[error] 9 |  summon[Mirror.Of[A]]
[error]   |                      ^
[error]   |no implicit argument of type deriving.Mirror.Of[A] was found for parameter x of method summon in object Predef

Expectation

It should compile.

Mirror.Of[A] should return a Mirror.SumOf[A] { type MirroredElemTypes = B *: A1 *: EmptyTuple }

@bishabosha
Copy link
Member

bishabosha commented Mar 16, 2021

this will be addressed by #11686, but currently it is explicitly part of the design to only support product cases as children

@dwijnand
Copy link
Member

dwijnand commented Mar 29, 2021

Duplicate of lampepfl/dotty-feature-requests#161

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