using System; using System.Collections.Generic; internal class C { internal struct VSlot { public readonly T Value; public VSlot (T value) { Value = value; } } internal IEnumerable GetEnumerable (IEnumerable> input) { foreach (var v in input) yield return v.Value; } } class C { public static int Main () { var c = new C (); string value = null; foreach (var v in c.GetEnumerable (new[] { new C.VSlot ("foo") })) { value = v; } if (value != "foo") return 1; return 0; } }