Skip to content

SA1648 - inheritdoc on constructors #2575

Closed

Description

@brinko99

SA1648 is being reported when <inheritdoc /> is used on constructors within a subclass of the same signature of the parent. Although there may not be a solid standard for inheritdoc, Sandcastle's implementation seems to be taking on that role and calls out support for constructors (ReSharper as well):

The inheritdoc element is valid at the root level (i.e. the same level as summary elements) on types, interfaces, virtual members, interface member implementations, and constructors.

I suggest that StyleCopAnalyzers supports this usage.

/// <summary>
/// A class
/// </summary>
public class A
{
    /// <summary>
    /// Initializes a new instance of the <see cref="A"/> class.
    /// </summary>
    /// <remarks>Initializes hardware...</remarks>
    public A()
    {
    }
}

/// <summary>
/// B class
/// </summary>
public class B : A
{

    /// <summary>
    /// Initializes a new instance of the <see cref="B" /> class.
    /// </summary>
    /// <inheritdoc />
    public B()
    {
    }
}

Activity

  1. sharwell commented on Jan 25, 2018

    @sharwell
    Member

    Agree, and this aligns with my proposal here: dotnet/csharplang#313 (comment)

  2. added this to the 1.2-beta.next milestone on Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions