HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.11k stars 648 forks source link

operator overloading with ambiguous enum fails #11029

Open Antriel opened 1 year ago

Antriel commented 1 year ago

Order dependent – switching the enum declarations makes it work. Probably related to some other existing issue(s), but I didn't find any exact one.

function main() {
    var a:A = null;
    a >> Bar; // Errors: should be Int
}
abstract A({}) {
    @:op(A >> B) public function op(b:Foo):Void {}
}
enum Foo {
    Bar;
}
enum Baz {
    Bar;
}
Simn commented 1 year ago

Looks similar to #10981