MemoryPack icon indicating copy to clipboard operation
MemoryPack copied to clipboard

Interface and Abstract Class Nesting

Open DJGosnell opened this issue 10 months ago • 0 comments

Expands upon #333 and allows for nesting inside abstract partial class and partial interface. Added tests for each type of nesting allowed.

This additionally fixes an issue with the current implementation where the XML remarks are added to the containing type instead of the MemoryPack type itself.

The only part about this that I feel unhappy with is the added Action in the Emit(StringBuilder writer, IGeneratorContext context, Action appendTypeRemarks) method. The reason I did this was I needed to capture multiple variables in another scope with the AppendTypeRemarks(string? serializationInfoLogDirectoryPath, TypeMeta typeMeta, StringBuilder sb, string fullType) method as the remarks need to be applied to different locations based upon usage of either the typeMeta.EmitUnionFormatterTemplate or the typeMeta.Emit

If you have a better idea, I am happy to re-work it to be cleaner.

DJGosnell avatar Mar 27 '25 16:03 DJGosnell