1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Anonymous type improvements

This commit is contained in:
Brian Fiete 2025-01-02 16:19:26 -08:00
parent 97c119cbc7
commit 01c2c35fc3
2 changed files with 19 additions and 8 deletions

View file

@ -14,6 +14,10 @@ class Anonymous
retVals.mB = 2;
return retVals;
}
public enum { Left, Right } GetDirection() => .Right;
public enum : int { A, B, C } Val => .C;
}
struct StructB
@ -37,6 +41,9 @@ class Anonymous
Test.Assert(val.mA == 0);
Test.Assert(val.mB == 0);
Test.Assert(sa.GetDirection() == .Right);
Test.Assert(sa.Val == .C);
StructB sb = default;
sb.mX = 345;
Test.Assert(sb.mY == 345);