-
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
Pick right type parameters for opaqueToBounds in TreeUnpickler #13206
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3-issue wombo!
Should this be backported to the release branch given the number of issues it fixes? |
Also fixes #12927 (I believe this one needs an sbt scripted test) |
Silly me opening all those issues 😜 |
I am still trying to figure out the failure in onnx-scala. I'll also add tests that work. |
Customized printer instead of falling back to toString
Type parameter Ax needs to be declared explicitly as covariant since Tensor is opaque. This fell through the cracks before since under separate compilation type parameters of opaque types got assigned structural variances. But this is incorrect. Under joint compilation there would be an error.
I have added tests for everything except #12927. I leave adding a test for that to someone who has more sbt foo than I. |
onnx-scala was frustrating. I first could not get it to test separately. Once I managed that, I thought that it was a problem in unpickler. Once I fixed that with great effort I found out that all other fixed issues broke again. So I finally figured out that the original version of unpickler was correct and the fault was in onnx-scala. The fault was this: The type parameters of a regular type alias get variances as determined by the right hand side. For instance in
Before this PR, and only under separate compilation, the type parameters of opaque types would get the variances from the right hand side. That's what made onnx-scala compile before. |
I'll push a test for #12927 |
@griggt Great. Thanks! |
What is the branch on which one has to rebase the backport? |
It's release-3.0.2: https://github.com/lampepfl/dotty/tree/release-3.0.2 |
Hepta-kill! |
So this should be in the 3.0.3 release? |
The backport is #13219, and it needs work to land. |
We passed the TypeParamRefs instead of the type param symbols when unpickling (but not in Namer).
Fixes #12945
Fixes #13001
Fixes #13190
Also:
Fixes #12950
Fixes #13128
Fixes #12927