Since the values ββof your enums are implicitly integers:
public enum Enum1 { ONE = 0, TWO = 1 } public enum Enum2 { A = 0, B = 1 }
Enum1 values ββare implicitly converted to integers, and then to Enum2 values. If you redefined Enum1 as follows:
public enum Enum1 { ONE = 0, TWO = 1, THREE = 2, }
... then fail will not return "A, B" because in Enum2 there is no value for the integer value 2
source share