Open kevinresol opened 3 months ago
I stumbled across this issue https://github.com/HaxeFoundation/hxcpp/issues/441 which points to this example code: https://github.com/HaxeFoundation/hxcpp/blob/8eeeee784cca9a271c023030d56e3f6db426076c/test/native/tests/TestNativeEnum.hx
Equality check ((...:SystemMetricStruct) == OS) in Haxe generates this c++ code, which works ✅ :
(...:SystemMetricStruct) == OS
cpp::Struct<wxSystemMetric, cpp::EnumHandler> val = // ... if (::hx::IsInstanceEq( wxSYS_OS, val )) { ... }
Switch case (switch (...:SystemMetricStruct) {case OS: ... }) in Haxe generates this c++ code, which does not work ❌ :
switch (...:SystemMetricStruct) {case OS: ... }
cpp::Struct<wxSystemMetric, cpp::EnumHandler> _hx_switch_0 = // ... if ( (_hx_switch_0==wxSYS_OS) ) { ... }
Error: ./src/RunTests.cpp:235:34: error: use of overloaded operator '==' is ambiguous (with operand types 'cpp::Struct<wxSystemMetric, cpp::EnumHandler>' and 'wxSYS_OS') if ( (_hx_switch_0==wxSYS_OS) ){
I stumbled across this issue https://github.com/HaxeFoundation/hxcpp/issues/441 which points to this example code: https://github.com/HaxeFoundation/hxcpp/blob/8eeeee784cca9a271c023030d56e3f6db426076c/test/native/tests/TestNativeEnum.hx
Equality check (
(...:SystemMetricStruct) == OS
) in Haxe generates this c++ code, which works ✅ :Switch case (
switch (...:SystemMetricStruct) {case OS: ... }
) in Haxe generates this c++ code, which does not work ❌ :