-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Missing generic tuple extractors in patterns #13968
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
An alternative is to cast the tuple type case val x3: Int *: Int *: EmptyTuple = x2.get
case val x4: Tuple2[_, _] = x3.asInstanceOf[Tuple2[_, _]] case val x3: Int *: Int *: EmptyTuple = x2.get
case val x4: Tuple2[Int, Int] = x3.asInstanceOf[Tuple2[Int, Int]] @unchecked |
Or we could try to make |
In the JIT or in our transform phases/backend? Because it looks like it's delegating to a runtime call. Having recently done a pass over the extraction logic, I can't explain how |
Oh now I get it. It doesn't qualify in the version that I thought I was reading, which is the version you have in #13969. Phew, sanity recovered. I mean, there's still a subpattern of Tuple2.unapply being allowed to consume |
We optimize those in the |
It seems the pattern matching logic identifies at some point generic tuples of know size |
Compiler version
3.1.0 with
-Ycheck:all
Minimized code
Output
The issue is that we have a
Int *: Int *: EmptyTuple
and not aTuple2[Int, Int]
and therefore we do not have the member_1
. We do have theapply(0)
which does the same and erases/optimized to_1
in this case.Expectation
We should generate
x4.apply(0)
instead ofx4._1
. This should make it possible to also scale above the 22 tuple limit.The text was updated successfully, but these errors were encountered: