Skip to content

Commit

Permalink
Add private inteface methods parsing in JavaParser (#14643)
Browse files Browse the repository at this point in the history
  • Loading branch information
rochala authored Mar 9, 2022
1 parent e871ba9 commit 4fca4d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,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.Private)
val body =
if (bodyOk && in.token == LBRACE)
methodBody()
Expand Down
3 changes: 3 additions & 0 deletions tests/pos/i12956.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface Foo {
private void bar() {}
}

0 comments on commit 4fca4d8

Please sign in to comment.