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
Describe the bug
If as is to be a uniform cast syntax, then I would expect to be able to get raw values from enums with it, but that is not currently the case.
To Reproduce
Steps to reproduce the behavior:
E: @enum<u8> type = {
Value1;
Value2;
Value3;
}
main: () = {
// v1 : u8 = E::Value1; // ERROR: can't implicitly convert as expected
v2 : u8 = E::Value2.get_raw_value(); // Expected working behavior
v3 : u8 = E::Value3 as u8; // ERROR: Uniform cast syntax doesn't work
}
Discussion
Obviously, with get_raw_value available this is not pressing from a "being able to get things done" point of view, but I found it surprising. I expected that being explicit about wanting the raw value was sufficient.
** Edit note **
The way meson handles subprojects seems to be confusing me. Originally posted quoting quite an old commit, but the error persists on the current leading edge.
Activity
gregmarr commentedon Nov 13, 2023
@dwmckee Have you tried this branch? (I'm not sure if it adds this, but it's ongoing work.) #701
dwmckee commentedon Nov 14, 2023
I have now.