Created
September 18, 2011 22:02
-
-
Save jskripsky/1225608 to your computer and use it in GitHub Desktop.
Possible mono bug: IList.Contains does automatic/implcit conversion between enums (or casts to int).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
namespace Test { | |
enum Set { | |
One = 1, | |
Two = 2, | |
Three = 3 | |
} | |
enum ItemOne { | |
One = 1 | |
} | |
class Dummy { | |
static public void Main() { | |
var list = new List<Set>(); | |
list.Add(Set.One); | |
Console.WriteLine(((IList)list).Contains(ItemOne.One)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment