-
Notifications
You must be signed in to change notification settings - Fork 13
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
Cross-build to Scala 3 #78
Comments
is there someone from the @scala/collections who might like to tackle this? @Ichoran what can you tell us about how |
Looked at this a bit. It appears to me that So it ought to be possible to run the code generator on Scala 2 only, and then test the generated code with both Scala 2 and Scala 3. I got most of the way through performing this separation, but there is one (only one?) remaining roadblock. wip branch: https://github.com/SethTisue/scala-collections-laws/tree/scala3 |
I think I used TypeTag to get Scala-code-compatible method names and know which ones were actually public (instead of package private or whatever). A ClassTag could be used instead with name-demangling to get the names, but I'm not sure how to know which ones are Scala-public. I am not sure separation is easily possible. My dim recollection is that the code generation and the singletons are matched. I suppose the code generation could generate the singleton hooks instead (filling in any TypeTag stuff if needed). I think the type tags were used possibly at runtime to generate informative messages, but it should work just as well to use code generation to build the strings. Maybe it would make more sense to do it the other way: Scala 3 should generate the code and let Scala 2 run it. Then when Scala 3 drops library compatibility, you just stop testing Scala 2 code. More work, but maybe not that much more work. I haven't yet figured out how to get things like public method names and full class names with types out of Scala 3. |
Currently this isn't trivially possible because
TypeTag
is used. Needs some investigation to see what it's being used for and what replacing it would look like.The text was updated successfully, but these errors were encountered: