Community
Participate
Working Groups
I20051215-1506 The type hierarchy of Inner misses the anoymous subtype: class Outer { public class Inner {} // (non-static) inner member type public static class StaticMember {} } class Use { void m(Outer arg) { arg.new Inner() {}; // anonymous not in type hierarchy of Inner new Outer() {}; new Outer.StaticMember() {}; } } Maybe connected to bug 120667 (anonymous enums not in hierarchy)
Created attachment 44628 [details] Proposed patch and regression test Problem comes from the fact that the SourceTypeElementInfo doesn't have the allocation expression needed to correctly recreate the QualifiedAllocationExpression. Fix consists in creating a special SourceTypeElementInfo in the case of an anonymous type of a member type. When the SourceTypeConverter is invoked on such a type, an exception is thrown and caught, then a full parse is done.
Fix and tests released for 3.3M1 in HEAD.
Verified for 3.3 M1 using build I20060807-0010. However, it seems that it was already fixed in 3.2 build (ie. the anonymous subtype already appears in the hierarchy of Inner). So, I wonder if the fix is really necessary?