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
Java 9+ allows concrete private interface methods, but the scalac parser doesn't accept them
$> scalac B.java B.java:2: error: `;` expected but `{` found. private void foo() { return; } ^ 1 error
The text was updated successfully, but these errors were encountered:
src/compiler/scala/tools/nsc/javac/JavaParsers.scala should be modified as follows
src/compiler/scala/tools/nsc/javac/JavaParsers.scala
--- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -597,7 +597,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { val vparams = formalParams() if (!isVoid) rtpt = optArrayBrackets(rtpt) optThrows() - val isConcreteInterfaceMethod = !inInterface || (mods hasFlag Flags.JAVA_DEFAULTMETHOD) || (mods hasFlag Flags.STATIC) + val isConcreteInterfaceMethod = !inInterface || (mods hasFlag Flags.JAVA_DEFAULTMETHOD) || (mods hasFlag Flags.STATIC) || (mods hasFlag Flags.PRIVATE) val bodyOk = !(mods1 hasFlag Flags.DEFERRED) && isConcreteInterfaceMethod val body = if (bodyOk && in.token == LBRACE) {
Sorry, something went wrong.
@dengziming You can get it. 🌜 moyuzai
I will check this since I am a newbie 🤝
dengziming
Successfully merging a pull request may close this issue.
Java 9+ allows concrete private interface methods, but the scalac parser doesn't accept them
The text was updated successfully, but these errors were encountered: