[Mono-dev] [PATCH] NRE in gmcs with -doc flag
Atsushi Eno
atsushi at ximian.com
Mon Jul 23 00:32:45 EDT 2007
The patch itself looks good. Please commit. Thanks.
/doc stuff is not under (at least active) development in progress
because no one is interested in this feature. We will welcome someone
who is really interested in it. I used to write this part of code,
but I'm against this feature. (No thanks, I will never be persuated.)
Atsushi Eno
Bill Holmes wrote:
> Resent with the correct subject line (Mono-dev). Sorry for the double post.
>
> I was wondering if someone close to generating XML documentation in
> gmcs (or some other expert) could review this patch and give me the ok
> to commit. I thought I would try sending an e-mail to the list before
> filing a bug with the patch like I usually do. To validate this patch
> I performed the usual complete rebuild of mono and make check and the
> results look good.
>
> I found a null reference exception with the latest version of gmcs.
> Compiling the attached test.cs with the -doc flag I see the following
> error.
>
> error CS1569: Error generating XML documentation file `MyTest.xml'
> (`Object reference not set to an instance of an object')
>
> I was able to track it down to
> Mono.CSharp.DocUtil.GetMethodDocCommentName. Exception occurs on line
> 883 because mc.MemberName.TypeArguments is null for this case.
>
> I found a property in the Mono.CSharp.MemberName class
> CountTypeArguments does null checking and returns the count of
> TypeArguments or zero. I changed this property to also check the Left
> member variable before returning 0. Checking the Left variable is
> more consistent with the IsGeneric property in the same class. I did
> a reference lookup and found no other code using this property.
>
> Then I changed GetMethodDocCommentName to use the CountTypeArguments
> property to avoid the NRE.
>
> It is my guess that this area of the code is still a work in progress
> since the output xml doc file does not match MS csc. The difference I
> notice is as follows
>
> Mono output :
> <member name="M:Test.TestItf2.TestMethod``2">
>
> MS output :
> <member name="M:Test.TestItf2{System#Int32 at System#Double}#TestMethod">
>
> The attached proposed patch does not attempt to match the MS's output
> format; it avoids the NRE and follows the output format of current
> mono. Or at least what the original code was attempting to construct.
>
> -bill
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list