enum型の構築子による値同士の比較はできない
どうも、ご無沙汰です。
さて、これ、意外にハマりどころだと思うんです。つまり、
enum Foo {
foo(a: Int);
}
...
trace(foo(1) == foo(1)); // results in "false"
っていう話なのですが。
Nicolas は「まーそのうちやろうかな」的なノリみたいですね。
haXe 2.0 では改善されるのかなあ。されないだろうなあ。> Hello list, > > I have one more language suggestion: I think it might be useful to > be able to use == and != statement to compare enums with parameters > as well, for instance: == already works for enums with no parameter. But it's true that comparison is currently not recursive. I'll think about a way to improve that but don't hold your breath :) Nicolas
追記: Type.enumEq
comments (0)




