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.Sum for enums are not cached in companion in REPL #14540

Closed
bishabosha opened this issue Feb 22, 2022 · 3 comments · Fixed by #14557
Closed

Mirror.Sum for enums are not cached in companion in REPL #14540

bishabosha opened this issue Feb 22, 2022 · 3 comments · Fixed by #14557
Assignees
Labels
area:typeclass-derivation itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@bishabosha
Copy link
Member

bishabosha commented Feb 22, 2022

Compiler version

3.1.1

Minimized code

Edit: since #14540 (comment) I have adjusted to a repl example

scala> import scala.deriving.Mirror
scala> enum Foo { case A }
scala> assert(summon[Mirror.SumOf[Foo]] eq Foo)

Output

fail at runtime:

scala> assert(summon[Mirror.SumOf[Foo]] eq Foo)
java.lang.AssertionError: assertion failed
  at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
  ... 36 elided

Expectation

work, as in Scala 3.1.0

@bishabosha
Copy link
Member Author

bishabosha commented Feb 22, 2022

investigate if #14035 is the cause

@smarter smarter added the regression This worked in a previous version but doesn't anymore label Feb 22, 2022
@bishabosha bishabosha self-assigned this Feb 22, 2022
@nicolasstucki
Copy link
Contributor

@bishabosha I could not reproduce this issue.

@bishabosha
Copy link
Member Author

bishabosha commented Feb 24, 2022

this seems to only affect summoning a mirror for a class defined in a previous command in the repl, I have a fix coming

@bishabosha bishabosha changed the title Mirror.Sum for enums are not cached in companion Mirror.Sum for enums are not cached in companion in REPL Feb 24, 2022
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typeclass-derivation itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants