haxe
haxe copied to clipboard
Nightly Haxe/Hxcpp - Invalid constant when setting an abstract function param to a enum abstract value.
abstract class Foo {
abstract public function getData(type:Items = Sword):Void;
}
enum abstract Items(String) {
var Sword;
}
This code is considered fine on all targets besides hxcpp where we get the following error
[ERROR] src/Main.hx:8: characters 48-53
8 | abstract public function getData(type:Items = Sword):Void;
| ^^^^^
| Invalid constant : Sword
Error does not occur on haxe 4.3.7, on nightly haxe(5.0.0-preview.1+90a2a3c) js/neko/hl/eval all compile fine (https://try.haxe.org/#bf87b284)
I wonder if it could be somehow related to #11666?