Skip to content

Commit 4fca4d8

Browse files
authored
Add private inteface methods parsing in JavaParser (#14643)
1 parent e871ba9 commit 4fca4d8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ object JavaParsers {
594594
val vparams = formalParams()
595595
if (!isVoid) rtpt = optArrayBrackets(rtpt)
596596
optThrows()
597-
val bodyOk = !inInterface || mods.isOneOf(Flags.DefaultMethod | Flags.JavaStatic)
597+
val bodyOk = !inInterface || mods.isOneOf(Flags.DefaultMethod | Flags.JavaStatic | Flags.Private)
598598
val body =
599599
if (bodyOk && in.token == LBRACE)
600600
methodBody()

tests/pos/i12956.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface Foo {
2+
private void bar() {}
3+
}

0 commit comments

Comments
 (0)