using System; using System.Reflection; public struct Container { public T content; public Container (T content) { this.content = content; } } public class A { public Container field; public A () { field = new Container (0xdeadbeaf); } } public class M { public static int Main() { A a = new A(); if (a.field.content != 0xdeadbeaf) return 1; FieldInfo fi = a.GetType().GetField("field"); object o = fi.GetValue (a); Container unboxed = (Container) o; if (unboxed.content != 0xdeadbeaf) return 2; return 0; } }