Skip to content

IDISP010 False warning when base method is abstract #575

Open
@Emik03

Description

@Emik03

Classes like the standard library's MemoryManager<T> have an abstract dispose method, which cannot be called despite the lint asking for it to be invoked.

sealed class Manager : MemoryManager<byte>
{
    /// <inheritdoc />
    public override void Unpin() { }

    /// <inheritdoc />
    public override unsafe MemoryHandle Pin(int elementIndex = 0) => default;

    /// <inheritdoc />
    public override unsafe Span<byte> GetSpan() => default;

    /// <inheritdoc />
    protected override void Dispose(bool disposing) { } // <-- lint occurs here
}

Activity

dlebansais

dlebansais commented on Jun 21, 2025

@dlebansais

Thank you for the bug report. I added the fix to my own fork of this great project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @Emik03@dlebansais

      Issue actions

        IDISP010 False warning when base method is abstract · Issue #575 · DotNetAnalyzers/IDisposableAnalyzers