-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Type inference failure for type variable in intersection type #12077
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
Comments
this issue and #12051 may have some connections |
This is kind of a weird encoding ( trait Wrapper[K]
trait Has0[T]
object Test {
def test[R](v: Wrapper[Has0[String] | R]): R = ???
val zz: Wrapper[Has0[String] | Has0[Int]] = ???
test(zz) // Infers R=Has0[Int]
} |
@smarter not sure if this is an issue or not, but it seems that ZIO uses this kind of encoding now. Except that |
btw, the inference works for zero-kinded types |
Compiler version
2.13.5 and 3.0.0-RC2
Minimized code
This code compiles in 2.13.5 but not in 3.0.0-RC2.
Output
Error in 3.0.0-RC2
Expectation
The text was updated successfully, but these errors were encountered: