Skip to content

Instantly share code, notes, and snippets.

@jskripsky
Created September 18, 2011 22:02
Show Gist options
  • Save jskripsky/1225608 to your computer and use it in GitHub Desktop.
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).
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