Repository navigation
IronJava v2.1.1 Release Notes
🐛 Bug Fixes
Fixed: Nested Types Not Being Populated
- Issue: Nested type declarations (inner classes, interfaces, enums) were being parsed but not populated in
the NestedTypes property of their parent types - Root Cause: The BuildClassMembers method was attempting to cast nested type declarations as
MemberDeclaration, which failed silently, causing nested types to be ignored - Solution:
- Created separate BuildClassBody, BuildInterfaceBody, and BuildEnumBody methods that properly separate
members from nested types - Updated all type declaration visitors to use these new methods
- Nested types are now correctly populated in the AST
- Created separate BuildClassBody, BuildInterfaceBody, and BuildEnumBody methods that properly separate
🔧 Technical Details
Files Modified:
- AstBuilder.cs - Implemented proper nested type handling in the parser
- Added ClassBodyResult helper class to return both members and nested types
- Modified BuildClassMember to only handle actual members (fields, methods)
- Created new methods to properly parse and categorize nested types
What This Fixes:
- ClassDeclaration.NestedTypes now correctly contains inner classes, interfaces, enums
- InterfaceDeclaration.NestedTypes now correctly contains nested types
- EnumDeclaration.NestedTypes now correctly contains nested types
- The Body property correctly includes both members and nested types
✅ Verification
Tested with complex nested structures:
public class OuterClass {
public class InnerClass { }
public static class StaticNestedClass { }
public interface NestedInterface { }
public enum NestedEnum { VALUE1, VALUE2 }
}
All nested types are now properly accessible via the AST.
📦 No Breaking Changes
This is a bug fix release with no API changes. Existing code will continue to work as before, but will now
correctly receive nested type information.