This project is read-only.
1
Vote

Method with generic argument appears twice in derived class docs.

description

Given the following code:
 
public abstract class GenericClassBase<T>
{
 
/// <summary>
/// Summary
/// </summary>
/// <param name="arg1">arg1</param>
protected abstract void Method1(T arg1);
 
}
 
public abstract class Derived2<T> : GenericClassBase<T>
{
 
/// <summary>
/// Derived2 Summary
/// </summary>
/// <param name="arg1">Derived2 arg1</param>
protected override sealed void Method1(T arg1)
{
}
 
}
 
public abstract class Derived1<T> : GenericClassBase<T>
{
 
/// <summary>
/// Derived1 Summary
/// </summary>
/// <param name="arg1">Derived1 arg1</param>
protected override sealed void Method1(T arg1)
{
}
 
}
 
The documentation for Derived1 contains 2 entries for 'Method1' where it should only contain 1:
 
Method1(T) - Derived1 Summary
 
Method1(T) - Summary (Inherited from GenericClassBase(T))
 
The documentation for Derived2 is as follows:
 
Method1 - Derived2 Summary (Overrides GenericClassBase(T).Method1(T))
 
(Note, the ommission of the (T) parm on the Method1 is not my mistake. I'm not sure if that is correct or not).
 
I've made the following observations regarding the problem:
 
The arg1 type must be of type T
Which ever method appears second in the source (Derived1 or Derived2) is the one with 2 Method1 entries in the documentation.
It makes no difference if I remove all documentation from the members.
It makes no difference if I explicitly document the base class member and then use inheritdoc for the two overrides.
It makes no difference If I rename the arguments in the overriden methods to arg2 and arg3.
It makes no difference if I remove 'abstract' from the derived classes, or 'sealed' from the derived methods.

comments