We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.2.0-RC1
//> using scala "3.2.0-RC1" class X1 class X2 transparent inline def foo: X1 | X2 = new X1 transparent inline def bar: (X1 | X2, X1 | X2) = (foo, foo) val x: (X1, X1) = bar
[error] ./Transparent.scala:12:19: Found: (X1 | X2, X1 | X2) [error] Required: (X1, X1) [error] val x: (X1, X1) = bar [error] ^^^
After inlining the type of x should be known to be (X1, X2) and the entire snippet should compile.
x
(X1, X2)
The text was updated successfully, but these errors were encountered:
I think this is a duplicate of #8739, feel free to reopen if not
Sorry, something went wrong.
transparent inline def foo: Int | Boolean = 2 transparent inline def bar: Option[Int | Boolean] = Some(foo) val x: Some[Int] = bar
The issue is that we are not refining the inferred type parameter of the Some.apply method. It is similar to #8739.
Some.apply
Same issue with
transparent inline def bar(x: Int | Boolean): Option[Int | Boolean] = Some(x) val x: Some[Int] = bar(2)
but this one has a workaround if we use Some[x.type](x)
Some[x.type](x)
nicolasstucki
No branches or pull requests
Compiler version
3.2.0-RC1
Minimized code
Output
Expectation
After inlining the type of
x
should be known to be(X1, X2)
and the entire snippet should compile.The text was updated successfully, but these errors were encountered: