haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Lambda.count with Map<enum abstract,X> : should be Iterable<Unknown<0>>

Open filt3rek opened this issue 6 months ago • 0 comments

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

filt3rek avatar May 07 '25 07:05 filt3rek