mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-24 18:48:01 +02:00
Fixed premature enum finalization during cast
This commit is contained in:
parent
ef942366db
commit
95c6b1db98
2 changed files with 16 additions and 4 deletions
|
@ -43,6 +43,17 @@ namespace Tests
|
|||
case EE(EnumE ee);
|
||||
}
|
||||
|
||||
enum EnumG
|
||||
{
|
||||
case A = (.)'A';
|
||||
case B = (.)'B';
|
||||
|
||||
public void Set(int val) mut
|
||||
{
|
||||
this = (.)val;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
static void TestBasic()
|
||||
{
|
||||
|
@ -122,7 +133,10 @@ namespace Tests
|
|||
}
|
||||
|
||||
ee = .B(10);
|
||||
|
||||
|
||||
EnumG eg = .A;
|
||||
eg.Set(66);
|
||||
Test.Assert(eg == .B);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue