HaxeFoundation / HaxeFoundation/haxe

@:java.default vs. interface order

Open
#10,467 7 comments 0 reactions 0 assignees View on GitHub
bug platform-java platform-jvm
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

@kevinresol found a problem with #10466 which I have isolated to this case:

```haxe
extern interface I1 {
@:java.default function test():Void;
}

extern interface I2 {
function test():Void;
}

class C implements I1 implements I2 {

}

function main() {

}
```

This fails with `Field test needed by I2 is missing`. If the `implements` order of `I1` and `I2` is swapped, the error disappears. The compiler doesn't normally care about identical interface methods, so it just picks whichever it finds first.

This seems annoying to handle...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.