Skip to content
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

Support parsing record classes in Java source files #14846

Closed
smarter opened this issue Apr 4, 2022 · 9 comments · Fixed by #16762
Closed

Support parsing record classes in Java source files #14846

smarter opened this issue Apr 4, 2022 · 9 comments · Fixed by #16762
Assignees
Milestone

Comments

@smarter
Copy link
Member

smarter commented Apr 4, 2022

We need to forward-port @harpocrates's scala/scala#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 smarter added itype:bug compat:java Spree Suitable for a future Spree labels Apr 4, 2022
@harpocrates
Copy link
Contributor

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

@charpov
Copy link
Contributor

charpov commented Jul 23, 2022

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
Copy link
Contributor

charpov commented Sep 12, 2022

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.

@scala-center-bot
Copy link

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.

@TheElectronWill
Copy link
Contributor

TheElectronWill commented Jan 24, 2023

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

@scala-center-bot
Copy link

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
Copy link

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.

@mbovel
Copy link
Member

mbovel commented Mar 20, 2023

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

@mbovel mbovel removed the Spree Suitable for a future Spree label Mar 20, 2023
@SethTisue
Copy link
Member

SethTisue commented Apr 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants