using System.Collections.Generic; class Bad { public static void Main(string[] args) { var names = GetNames(); var list = (List) names; list.Add("Eve"); } static IEnumerable GetNames() { var ret = new List() { "Alice", "Bob" }; return ret; } }