We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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.4.0-RC3 (regressed since 3.3.1)
enum Op[A, B]: case Dup[T]() extends Op[T, (T, T)] def foo[R](f: [A, B] => (o: Op[A, B]) => R): R = f(Op.Dup()) foo([A, B] => (o: Op[A, B]) => { o match case o: Op.Dup[t] => summon[A =:= t] // ERROR: Cannot prove that A =:= t. summon[B =:= (t, t)] // ERROR: Cannot prove that B =:= (t, t). 42 })
https://scastie.scala-lang.org/PvLamiXMQXaEIWEf18kGXQ
Cannot prove that A =:= t. Cannot prove that B =:= (t, t).
The code should compile. It does compile with Scala 3.3.1
The text was updated successfully, but these errors were encountered:
A perhaps minimised but more confusing version:
enum Op[A]: case Dup[T]() extends Op[(T, T)] def foo[R](f: [A] => Op[A] => R): R = ??? def test = foo[Unit]([A] => (o: Op[A]) => o match case o: Op.Dup[u] => summon[A =:= (u, u)] // Ok () ) foo/*[Unit]*/([A] => (o: Op[A]) => o match case o: Op.Dup[u] => summon[A =:= (u, u)] // Error: Cannot prove that A =:= (u, u) () ) foo/*[Unit]*/( { val f1 = [B] => (o: Op[B]) => o match case o: Op.Dup[u] => summon[B =:= (u, u)] // Also ok () f1 } )
Sorry, something went wrong.
dwijnand
Successfully merging a pull request may close this issue.
Compiler version
3.4.0-RC3
(regressed since 3.3.1)
Minimized code
https://scastie.scala-lang.org/PvLamiXMQXaEIWEf18kGXQ
Output
Expectation
The code should compile. It does compile with Scala 3.3.1
The text was updated successfully, but these errors were encountered: