-
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
Java and Scala compilers treat records differently, Scala compiler not exposing accessor methods #19386
Comments
Same in Scala 2. Except more carets in Scala 3.
|
We change the proxy method to take in a single argument. This also exposed a second issue where the overriden methods were not invalidated correctly in the `Namer`.
Folks, is there a plan to incorporate the fix to this issue into the 3.3 LTS? |
I think this should be backported, and I'm using Java 21 LTS at work too. |
No one asked, but scala/scala#10715 |
IMHO incompatibility with Java is a significant bug to remain in LTS version of Scala. |
Moreover, it represents a real challenge to developers who work on mix Java-Scala projects. |
The workaround is Someone always mentions that setting eventually. I've never actually used it but it's an easy internet search. |
Would this be required for tools such as Scala plugin for IntelliJ? Or would this setting be integral to Scala 3.3 LTS compiler settings so no other client code / tool has to think about this? |
Folks, 3.4.1 seems to have resolved this issue. But since 3.3 is supposed to be Long Term Support, I will please request the fixes to be brought in to 3.3 as well. As of 3.3.3, I am still seeing the same problem. I am not sure who to reach for this request, so just adding it to this ticket. |
@ek-gh I don't what the process is, but the PR is labelled |
We change the proxy method to take in a single argument. This also exposed a second issue where the overriden methods were not invalidated correctly in the `Namer`. [Cherry-picked 47511ae]
We change the proxy method to take in a single argument. This also exposed a second issue where the overriden methods were not invalidated correctly in the `Namer`. [Cherry-picked 47511ae]
We change the proxy method to take in a single argument. This also exposed a second issue where the overriden methods were not invalidated correctly in the `Namer`. [Cherry-picked 47511ae]
We change the proxy method to take in a single argument. This also exposed a second issue where the overriden methods were not invalidated correctly in the `Namer`. [Cherry-picked 47511ae]
) Backports #19583 to the LTS branch. PR submitted by the release tooling. [skip ci]
Compiler version
3.3.1
Minimized code
MyRecord.java:
MyTest.scala
If MyJavaRecord is compiled with java compiler, and MyScalaObject is compiled with scala compiler using class file generated by Java compiler for the record, you'd get no syntax errors from scala compiler.
If MyJavaRecord & MyScalaObject are both compiled with scala compiler, first println would give you syntax error.
Expectation
When record is compiled via Scala compiler, it exposes accessor methods to the fields just like Java compiler. We should get no errors compiling both with scala compiler. Scala compiler should not enforce a syntax for java data type that is illegal by java compiler.
The text was updated successfully, but these errors were encountered: