How to correctly compare algebraic Enums?

enum E {
    One(i: Int);
}

class Main {
    public static function main() {
        var o1 = One(123);
        var o2 = One(123);

        var is = (o1 == o2);
        trace( is );
    }
}

Output is false. Why? How can I correctly compare two identical enums?

Try o1.equals(o2), which actually comes from haxe.EnumValueTools.equals which basically just calls Type.enumEq in the end.

Thanks, that is what I was looking for! Wondering why == doesn’t do the same though.