http://bugzilla.novell.com/show_bug.cgi?id=591727
http://bugzilla.novell.com/show_bug.cgi?id=591727#c0 Summary: Using typeof on nested generic classes throws runtime exception Classification: Mono Product: Mono: Compilers Version: unspecified Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: C# AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: Community User Blocker: No If you have two classes that are generic with one of them being a sub-class of the other then when you attempt to use the typeof operator without qualifying the full class path the runtime will throw a System.TypeLoadException. The following code will reproduce the issue: using System; namespace MonoTest { public class Foo<T> { public class Bar<U> { } public Type Works() { return typeof(Foo<>.Bar<>); } public Type Broken() { return typeof(Bar<>); } } class Program { static void Main(string[] args) { var foo = new Foo<double>(); foo.Works(); foo.Broken(); } } } The above code work properly when compiled with Microsoft's compiler and executed with the mono runtime. As shown above, the work around is to use the fully qualified class declaration. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
