{"record":{"id":"73d3e44c491bd14b","repo":"AvaloniaUI/Avalonia","slug":"overlap-alignment-mismatch","errorCode":null,"errorMessage":"Overlap alignment mismatch.","messagePattern":"Overlap alignment mismatch\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"src/Avalonia.Base/Collections/Pooled/ThrowHelper.cs","lineNumber":76,"sourceCode":"            throw new IndexOutOfRangeException();\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowArgumentOutOfRangeException()\n        {\n            throw new ArgumentOutOfRangeException();\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowArgumentException_DestinationTooShort()\n        {\n            throw new ArgumentException(\"Destination too short.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowArgumentException_OverlapAlignmentMismatch()\n        {\n            throw new ArgumentException(\"Overlap alignment mismatch.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowArgumentOutOfRange_IndexException()\n        {\n            throw GetArgumentOutOfRangeException(ExceptionArgument.index,\n                                                    ExceptionResource.ArgumentOutOfRange_Index);\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowIndexArgumentOutOfRange_NeedNonNegNumException()\n        {\n            throw GetArgumentOutOfRangeException(ExceptionArgument.index,\n                                                    ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowValueArgumentOutOfRange_NeedNonNegNumException()","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Collections/Pooled/ThrowHelper.cs#L58-L94","documentation":"Centralized ThrowHelper.ThrowArgumentException_OverlapAlignmentMismatch throws ArgumentException \"Overlap alignment mismatch.\" It is ported from the .NET BCL ThrowHelper for span/array copy operations where source and destination overlap in a way that is not allowed. In the current Avalonia codebase it has no active call site (grep finds only the definition), so it is effectively reserved/vestigial — a normal Avalonia user cannot reach it through PooledList/PooledStack public APIs.","triggerScenarios":"Would be invoked by internal array/span copy code that detects overlapping source and destination whose alignment makes a copy undefined. No public PooledList/PooledStack method in this tree currently routes to it.","commonSituations":"Effectively unreachable through the public API; could surface only if future internal copy helpers wire it up. Seeing it implies a custom/internal caller was added.","solutions":["This is not reachable via public Avalonia collection APIs today — verify you are not calling an internal helper.","If you maintain a fork that calls overlapping copies, ensure source and destination do not overlap, or are aligned when they do.","Report it if it appears unexpectedly, since it indicates a code path that was assumed unreachable."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Unreachable via public APIs today. If you fork overlapping-copy helpers:\n// ensure source and destination spans do not overlap before copying.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not invoke internal array-copy helpers that pass overlapping regions.","If overlap is unavoidable, ensure identical alignment so copies are well-defined.","Treat an unexpected occurrence as a signal that a new internal caller was added."],"tags":["csharp","pooled","throwhelper","copy","unreachable"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}