We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Scala compiler version 3.0.0
Interface.java
package example; public interface Interface { private void m() {} }
$ scalac Interface.java -- Error: Interface.java:4:19 -------------------------------------------------- 4 | private void m() {} | ^ | ';' expected but '{' found. -- [E060] Syntax Error: Interface.java:4:15 ------------------------------------ 4 | private void m() {} | ^ | abstract method m may not have `private` modifier 2 errors found
Unable to parse private methods of interfaces introduced in Java 9.
Must be able to parse normally.
See the Scala2 issue.
scala/bug#12393
It should be modified as follows.
--- a/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala @@ -608,7 +608,7 @@ object JavaParsers { val vparams = formalParams() if (!isVoid) rtpt = optArrayBrackets(rtpt) optThrows() - val bodyOk = !inInterface || mods.isOneOf(Flags.DefaultMethod | Flags.JavaStatic) + val bodyOk = !inInterface || mods.isOneOf(Flags.DefaultMethod | Flags.JavaStatic | Flags.PrivateMethod) val body = if (bodyOk && in.token == LBRACE) methodBody()
The text was updated successfully, but these errors were encountered:
anatoliykmetyuk
Successfully merging a pull request may close this issue.
Compiler version
Scala compiler version 3.0.0
Minimized code
Interface.java
Output
Expectation
Unable to parse private methods of interfaces introduced in Java 9.
Must be able to parse normally.
See the Scala2 issue.
scala/bug#12393
It should be modified as follows.
The text was updated successfully, but these errors were encountered: