-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Compiler crash when deriving enums #15183
Labels
Comments
WojciechMazur
added
itype:bug
itype:crash
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
May 13, 2022
Minimized further: //> using scala "3.2.0-RC1-bin-20220512-9dbe2d3-NIGHTLY"
import scala.deriving._
enum Env:
case Local,Sit,Prod
sealed trait Decoder[T]
object Decoder:
given summonTuple[H, T <: Tuple]: Tuple.Map[H *: T, Decoder] = ???
def derived(using m: Mirror.Of[Env], d: Tuple.Map[m.MirroredElemTypes, Decoder]): Decoder[Env] = ???
val x = Decoder.derived |
prolativ
added
area:typer
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
May 16, 2022
griggt
added a commit
to griggt/dotty
that referenced
this issue
May 30, 2022
griggt
added
the
regression
This worked in a previous version but doesn't anymore
label
May 30, 2022
griggt
added a commit
to griggt/dotty
that referenced
this issue
May 31, 2022
griggt
added a commit
to griggt/dotty
that referenced
this issue
May 31, 2022
bishabosha
pushed a commit
to dotty-staging/dotty
that referenced
this issue
Oct 18, 2022
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 3, 2024
We now try to reduce match types before computing their contributions to an implicit scope. This avoids problems where joint and separate compilations gave different results, as in scala#20071 and scala#15183. Background: If a match type is reducible to a type R the compiler is free to replace the match type with R. That should not affect the implicit scope computation. Consequently, we have to try to reduce match types before computing their contributions to an implicit scope. scala#20071 and scala#15183 are really the same problem. Both used to compile in sequence and both gave an implicit not found error when two files were compiled together. In scala#15183 a weird match type was constructed intentionally, in order to avoid an otherwise necessary given import. That exploited a bug in the compiler which this PR fixes.
This will unfortunately no longer work. |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 3, 2024
We now try to reduce match types before computing their contributions to an implicit scope. This avoids problems where joint and separate compilations gave different results, as in scala#20071 and scala#15183. Background: If a match type is reducible to a type R the compiler is free to replace the match type with R. That should not affect the implicit scope computation. Consequently, we have to try to reduce match types before computing their contributions to an implicit scope. scala#20071 and scala#15183 are really the same problem. Both used to compile in sequence and both gave an implicit not found error when two files were compiled together. In scala#15183 a weird match type was constructed intentionally, in order to avoid an otherwise necessary given import. That exploited a bug in the compiler which this PR fixes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Compiler version
3.1.2
Fails with 3.2.0-RC1-bin-20220512-9dbe2d3-NIGHTLY
Works with 3.1.1
Minimized code
Based on:
decoder.scala
test.scala
decoder.scala
andtest.scala
needs to be compiled seperetlyOutput (click arrow to expand)
The text was updated successfully, but these errors were encountered: