haxe
haxe copied to clipboard
Lambda.count with Map<enum abstract,X> : should be Iterable<Unknown<0>>
Hej,
This piece of code fails : https://try.haxe.org/#C48f1122
enum abstract MyE(String) /*to String*/{ // <-- Works with "to String"
var MEA;
var MEB;
}
class Test {
static var h:Map<MyE, Bool> = [MEA => true, MEB => true];
static function main() {
var len = Lambda.count(h); // <-- Map<MyE, Bool> should be Iterable<Unknown<0>>
for (o in h) { // <-- Always ok
trace(o);
}
}
}
The for loop see that h is iterable but Lambda.count doesn't see that. If I add to String to the enum abstract, it works fine.
Thanks for your help