scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Support parsing record classes in Java source files

Open smarter opened this issue 2 years ago • 6 comments

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.

smarter avatar Apr 04 '22 19:04 smarter

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.

som-snytt avatar Apr 19 '22 17:04 som-snytt

Thanks and I'm sorry I didn't do the right thing of porting this over to Dotty. I must've just forgotten... 😬

harpocrates avatar Apr 19 '22 17:04 harpocrates

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.

charpov avatar Jul 23 '22 14:07 charpov

I'll make time some time for this, as a break from another PR with annoying test failures.

som-snytt avatar Jul 23 '22 15:07 som-snytt

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.

charpov avatar Sep 12 '22 22:09 charpov

I suspect I figured out the annoying test failures, but I don't have great success moving PRs thru the pipeline.

som-snytt avatar Sep 13 '22 00:09 som-snytt

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.

scala-center-bot avatar Nov 22 '22 09:11 scala-center-bot

We've started to work on it during the Spree with @odd. I'll open a WIP PR.

TheElectronWill avatar Jan 24 '23 17:01 TheElectronWill

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.

scala-center-bot avatar Feb 07 '23 09:02 scala-center-bot

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.

scala-center-bot avatar Feb 28 '23 15:02 scala-center-bot

Removing the Spree label as there is a finished open PR (#16762).

mbovel avatar Mar 20 '23 16:03 mbovel

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

SethTisue avatar Apr 12 '23 17:04 SethTisue