I get no output in VS 2003 and the same warnings, looks consistent. Nate Trimble
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, June 29, 2006 2:57 PM To: [email protected] Subject: [Mono-list] Reflection of non-public fields I'm not entirely sure I've got this right so I thought I'd run it past "the list" before I created a bug report. On running [1] I would expect to see "Hello World" but no output is produced. When I compile I see a couple of warnings about the fields not being used - is the compiler being clever here and removing the fields entirely? -- Colin [1]: using System; using System.Reflection; public class test_t { private string Hello; private string World; public static void Main() { foreach (FieldInfo fi in typeof(test_t).GetFields(BindingFlags.NonPublic)) { Console.Write("{0} ", fi.Name); } Console.WriteLine(); } } _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
