scala3
scala3 copied to clipboard
Support parsing record classes in Java source files
We need to forward-port @harpocrates's https://github.com/scala/scala/pull/9551. Note that our equivalent of Scala 2's JavaParsers is in https://github.com/lampepfl/dotty/blob/main/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala.
I got my feet wet on text blocks. The harpocratic oath requires I do no harm, or harp. I'll (try to) follow this up. No better way to learn about new java features.
Thanks and I'm sorry I didn't do the right thing of porting this over to Dotty. I must've just forgotten... 😬
Any progress on this, or an estimate as to when records will be supported? I'm dealing with Java applications with Scala tests, and it's frustrating not to be able to use records, especially since Scala 2 was fixed. Could this issue's priority be bumped up? Thanks.
I'll make time some time for this, as a break from another PR with annoying test failures.
I'll make time some time for this, as a break from another PR with annoying test failures.
Thank you. Just checking you didn't find something more interesting to do in the meantime ;-). I know it's a small thing (who uses Java records in mixed Scala/Java projects?), but I happen to have two projects with them, and it complicates my life tremendously.
I suspect I figured out the annoying test failures, but I don't have great success moving PRs thru the pipeline.
This issue was picked for the Issue Spree No. 24 of 29 November 2022 which takes place in a week from now. @odd, @markehammons will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.
We've started to work on it during the Spree with @odd. I'll open a WIP PR.
This issue was picked for the Issue Spree No. 26 of 14 February 2023 which takes place in a week from now. @odd, @yzia2000 will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.
This issue was picked for the Issue Spree No. 27 of 07 March 2023 which takes place in a week from now. @smarter, @TheElectronWill, @odd will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.
Removing the Spree label as there is a finished open PR (#16762).
If you are a user who is running into the lack of this, consider changing your project to set compileOrder
to use CompileOrder.JavaThenScala
(or, if appropriate for your code, CompileOrder.ScalaThenJava
) instead of the default CompileOrder.Mixed
. This will tell the Scala compiler not to attempt to process the Java sources.
see https://www.scala-sbt.org/1.x/docs/Java-Sources.html
when somebody on Discord hit this today, the error message from the compiler was "illegal start of type declaration", pointing to interface
in public sealed interface
in a Java source file