I notice that if Suit and SuitShort have an enum with the same name, then you still have to fully qualify the enum names when using the with statement. So, for example, if spd in SuitShort was renamed spades, the first entry in the array initialization would have to be {Suit.spades, 1, 6, SuitShort.spades}.

   with (Suit) with (SuitShort)
   {
       static Suits[] suits = [
           {spades,    1,  6, spd},
           {hearts,    4, 10, hrt},
           {diamonds,  4, 10, dmd},
           {clubs,    10, 16, clb}
       ];

       foreach (immutable member;  suits)
       ...


Bye,
bearophile

Reply via email to