#.require. clr @platform clr enum Color Red = 1 Green = 2 Blue = 4 enum F A = 1 B = 2 C = 4 D = 8 class Test shared def main .testColor .testF def testColor c = Color(Red, Green) print c print c to int .takeColor(Color(Red, Green)) # TODO: Should have a qualified example. System.SomeEnum(MemberA, MemberB) and System.Something.SomeEnum(MemberA, MemberB) # testing enum membership with bitwise-and assert c & Color.Red == Color.Red assert c & Color.Green == Color.Green assert c & Color.Blue <> Color.Blue def takeColor(c as Color) pass def testF f = F.A | F.B # a simple & is all that is required assert f & F.A assert f & F.B assert not (f & F.C) assert not (f & F.D) # but comparisons work too, though aren't necessary assert f & F.A == F.A assert f & F.B == F.B assert not (f & F.C == F.C) assert not (f & F.D == F.D)