[Mono-bugs] [Bug 425898] New: [gmcs] Generated XML documentation //member/@ name is wrong for methods w/ delegate arguments

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Sep 12 10:52:42 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=425898


           Summary: [gmcs] Generated XML documentation //member/@name is
                    wrong for methods w/ delegate arguments
           Product: Mono: Compilers
           Version: SVN
          Platform: x86-64
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jpryor at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


When using `gmcs -xml:foo.xml ...`, the //member/@name is wrong for methods
taking delegates which use type parameters.

To reproduce, take the following code:

  // XML documentation is generated wrong...
  using System;

  struct Maybe<T>
    {public readonly bool HasValue;
    private T value;
    public T Value
      {get {
        if (!HasValue) throw new InvalidOperationException ();
        return value;}}
    public Maybe (T value)
      {this.value = value; 
      HasValue = true;}}

  struct Tuple<T1,T2>
    {public readonly T1 _1;
    public readonly T2 _2;

    public Tuple(T1 a, T2 b)
      {_1 = a;
      _2 = b;}

    /// <summary>
    ///  Converts a <see cref="T:Tuple{T1,T2}" /> into a 
    ///  <typeparamref name="TResult" />.
    /// </summary>
    public TResult Match<TResult>(params Func<T1,T2,Maybe<TResult>>[] ms)
      {if (ms == null) throw new ArgumentNullException();
      foreach (var m in ms)
        {var r=m(_1,_2);
        if(r.HasValue) return r.Value;}
      throw new InvalidOperationException();}}

Compile it:
  gmcs -t:library -doc:gmcs-xml-bug.xml gmcs-xml-bug.cs

Then view the resulting gmcs-xml-bug.xml file:

  <?xml version="1.0"?>
  <doc>
    <assembly>
      <name>gmcs-xml-bug</name>
    </assembly>
    <members>
      <member name="M:Tuple`2.Match``1(System.Func`3[T1,T2,[Maybe`1[[TResult]],
gmcs-xml-bug, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]][])">
        <summary>
        Converts a <see cref="T:Tuple{T1,T2}" /> into a
        <typeparamref name="TResult" />.
        </summary>
      </member>
    </members>
  </doc>

The //member/@name attribute is obviously wrong; it should be:
  M:Tuple`2.Match``1(System.Func{`0,`1,Maybe{``0}}[])

This breaks monodocer XML documentation import of the above XML documentation
(i.e. the above member isn't imported with monodocer).


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list