You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) ){
The text was updated successfully, but these errors were encountered:
In fact, even the IsInstanceEq case doesn't really work because it is comparing a native enum directly with a cpp::Struct.
To make it work the compiler should also generate a c++ cast for the native enum value, i.e.
::hx::IsInstanceEq( (cpp::Struct<wxSystemMetric, cpp::EnumHandler>) wxSYS_OS, val )
The mentioned test file works only because of the extra function wrapping, where the arguments are explicitly typed as cpp::Struct, so any param going into the function will be cast correctly.
I stumbled across this issue #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 ❌ :The text was updated successfully, but these errors were encountered: