{"record":{"id":"af303c75a0e83956","repo":"AvaloniaUI/Avalonia","slug":"enumeration-has-ended","errorCode":null,"errorMessage":"Enumeration has ended.","messagePattern":"Enumeration has ended\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"warning","filePath":"src/Avalonia.Base/Collections/Pooled/ThrowHelper.cs","lineNumber":294,"sourceCode":"            throw new OutOfMemoryException();\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowArgumentException_Argument_InvalidArrayType()\n        {\n            throw new ArgumentException(\"Invalid array type.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowInvalidOperationException_InvalidOperation_EnumNotStarted()\n        {\n            throw new InvalidOperationException(\"Enumeration has not started.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowInvalidOperationException_InvalidOperation_EnumEnded()\n        {\n            throw new InvalidOperationException(\"Enumeration has ended.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowInvalidOperationException_EnumCurrent(int index)\n        {\n            throw GetInvalidOperationException_EnumCurrent(index);\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion()\n        {\n            throw new InvalidOperationException(\"Collection was modified during enumeration.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowInvalidOperationException_InvalidOperation_EnumOpCantHappen()\n        {\n            throw new InvalidOperationException(\"Invalid enumerator state: enumeration cannot proceed.\");","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Collections/Pooled/ThrowHelper.cs#L276-L312","documentation":"Centralized ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumEnded throws InvalidOperationException \"Enumeration has ended.\" It is the BCL-style helper for reading Current after MoveNext returned false. As with error 133, it has no active call site in this codebase: the shipped PooledStack enumerator inlines its own \"Enumeration has ended.\" message, and PooledList uses the combined EnumOpCantHappen helper. Reserved/vestigial.","triggerScenarios":"Would be thrown by an enumerator's Current getter when the cursor is past the last element. Not routed to by any shipped enumerator here.","commonSituations":"Not reachable via public enumerators; would surface only from a custom enumerator that calls this helper.","solutions":["Unreachable via shipped enumerators — verify you are not invoking a forked enumerator.","If you maintain such an enumerator, reset or recreate the enumerator instead of reading Current after exhaustion.","Use foreach to avoid reading Current after MoveNext returns false."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Unreachable via shipped enumerators. Do not read Current after MoveNext\n// returns false; recreate the enumerator to restart.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never read Current after an enumerator is exhausted.","Recreate enumerators to restart iteration rather than reusing them.","Use foreach to avoid out-of-band Current reads."],"tags":["csharp","pooled","throwhelper","enumeration","unreachable"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}