Skip to content

Commit 0a36919

Browse files
committed
Fix javac compilation - add default duplicate$default$N methods to Annotation interface
1 parent 879f773 commit 0a36919

File tree

1 file changed

+23
-0
lines changed
  • engine/runtime-parser/src/main/java/org/enso/compiler/core/ir

1 file changed

+23
-0
lines changed

engine/runtime-parser/src/main/java/org/enso/compiler/core/ir/JName.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,29 @@ interface Annotation extends JName, Definition {
184184
@Override
185185
Annotation duplicate(boolean keepLocations, boolean keepMetadata, boolean keepDiagnostics,
186186
boolean keepIdentifiers);
187+
188+
/**
189+
* These {@code duplicate$default$N} default methods need to be here, otherwise {@code javac}
190+
* would fail to compile with: "interface Annotation inherits unrelated defaults for {@code
191+
* duplicate$default$N} from types Expression and Definition". The {@link Annotation} interface
192+
* inherits from both {@link Expression} and {@link Definition} traits, and they both have their
193+
* own {@code duplicate$default$N} methods.
194+
*/
195+
default boolean duplicate$default$1() {
196+
return true;
197+
}
198+
199+
default boolean duplicate$default$2() {
200+
return true;
201+
}
202+
203+
default boolean duplicate$default$3() {
204+
return true;
205+
}
206+
207+
default boolean duplicate$default$4() {
208+
return false;
209+
}
187210
}
188211

189212
@GenerateIR(interfaces = {Annotation.class, IRKind.Primitive.class})

0 commit comments

Comments
 (0)