-
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
Typechecking regression in v3.1.2 #15178
Comments
still fails with 3.2.0-RC1-bin-20220511-7c446ce-NIGHTLY |
Can we find out where this regressed first? For the moment I am not even sure this is an error. I |
can you reproduce this without scalacheck? |
I'll try to minimize the example and remove scalacheck. |
Here is a short repro: trait E[F[_]] {
type T
val value: F[T]
}
object E {
def apply[F[_], T1](value1: F[T1]) = new E[F] {
type T = T1
val value = value1
}
}
val a: Option[E[Ordering]] = Option(E(Ordering[Int]))
a.map(it => E(it.value)) |
Regressed in 3ab18a9. |
Workaround: give an explicit result type to E.apply: object E {
def apply[F[_], T1](value1: F[T1]): E[F] = new E[F] {
type T = T1
val value = value1
}
} Otherwise the inferred type is |
So, can we close this? |
Compiler version
Works with v3.1.1, fails with v3.1.2 and v3.1.3-RC3.
First bad commit 3ab18a9
Minimized code
Output
Expectation
This snippet should continue compiling with scala v3.1.2.
The text was updated successfully, but these errors were encountered: