XML comments: reference a method in another class with generic parameter

.NET .1635

Hello,
create a new Class Library, enable XML comments and replace Class1.pas with:

namespace ClassLibrary1;
 
interface
 
  type
    /// <summary>
    ///   <see cref="Class1`1.DoSomething(T)" />
    /// </summary>
    /// <typeparam name="T"></typeparam>
    Class1 <T> = public class
    public
      method DoSomething (Value : T); empty;
    end;
 
    /// <summary>
    ///   <see cref="Class1`1.DoSomething(T)" />
    /// </summary>
    Class2 = public class
    end;
 
implementation
 
end.

Compile:

Class1.pas(16,11): warning W18: Unable to resolve XmlDoc tag “see cref” for “Class1`1.DoSomething(T)”

I can reference the method from the same class, but not from another one.

Thanks, logged as bugs://70147: XML comments: reference a method in another class with generic parameter

bugs://70147 got closed as fixed for release Constitution Class

Hello Patrick,

I fixed the issue. To reference the generic type you should use:

> /// <see cref="Class1&lt;T&gt;.DoSomething(T)" />

Best regards

Hello Viktoria,
this case is solved in .1645, but a new bug was added: I can no more reference a method without a parameter or without a generic parameter!
Please try with the following code:

namespace ClassLibrary1;
 
interface
 
  type
    /// <summary>
    ///   <see cref="Class1`1.DoSomething(T)" />
    /// </summary>
    /// <typeparam name="T"></typeparam>
    Class1 <T> = public class
    public
      method DoDomething; empty;
      method DoDomething (s : String); empty;
      method DoSomething (Value : T); empty;
    end;
 
    /// <summary>
    ///   <see cref="Class1`1.DoSomething" />
    ///   <see cref="Class1&lt;T&gt;.DoSomething" />
    ///
    ///   <see cref="Class1`1.DoSomething(String)" />
    ///   <see cref="Class1&lt;T&gt;.DoSomething(String)" />
    ///
    ///   <see cref="Class1&lt;T&gt;.DoSomething(T)" />
    /// </summary>
    Class2 = public class
    end;
 
implementation
 
end.

bugs://70147 got reopened

Hello Patrick,

Please check the method names (DoDomething vs DoSomething) in xml comments and class interface. When the names are the same you’ll have compiler resolve them correct.

Best regards.

bugs://70147 got closed as no change required for release Constitution Class

Hello,
corrected in .1669, thanks.