1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
delegate void Deleg (); class Foo : Object { public Object baz = new Object (); public void bar () { assert (baz != null); } } void main () { var foo = new Foo (); var deleg = (Deleg) foo.bar; foo = null; deleg (); }