Beef
Beef copied to clipboard
static payload enum variable behaves different in switch than local one
enum A
{
case A(int a);
case B;
}
static A a;
static void Main()
{
//let a = a;
switch (a)
{
case .A(let intThing):
case .B:
// default:
}
}
Without the commented-out local variable it demands a default case, and even if you give it that, compiling compiling crashes in code-gen.
With the local variable there, it accepts the switch without default and is fine compiling it.
This issue may be closed as it was fixed with pull-request by @Fusioon and additional fix by @bfiete https://github.com/beefytech/Beef/commit/11ccb876a3685f66d2c5e945045b156bd59530a2 Ready-for-testing project: bug.1780.zip