Skip to content

Instantly share code, notes, and snippets.

@jonpryor
Created August 24, 2010 12:28
Show Gist options
  • Save jonpryor/547467 to your computer and use it in GitHub Desktop.
Save jonpryor/547467 to your computer and use it in GitHub Desktop.
diff --git a/mcs/mcs/doc.cs b/mcs/mcs/doc.cs
index 2b4ca5d..7107568 100644
--- a/mcs/mcs/doc.cs
+++ b/mcs/mcs/doc.cs
@@ -741,10 +741,25 @@ namespace Mono.CSharp {
{
var tp = type as TypeParameterSpec;
if (tp != null) {
+ int c = 0;
+ type = type.DeclaringType;
+ while (type != null && type.DeclaringType != null) {
+ type = type.DeclaringType;
+ c += type.MemberDefinition.TypeParametersCount;
+ }
var prefix = tp.IsMethodOwned ? "``" : "`";
- return prefix + tp.DeclaredPosition;
+ return prefix + (c + tp.DeclaredPosition);
}
+ var pp = type as PointerContainer;
+ if (pp != null)
+ return GetSignatureForDoc (pp.Element) + "*";
+
+ ArrayContainer ap = type as ArrayContainer;
+ if (ap != null)
+ return GetSignatureForDoc (ap.Element) +
+ ArrayContainer.GetPostfixSignature (ap.Rank);
+
if (TypeManager.IsGenericType (type)) {
string g = type.MemberDefinition.Namespace;
if (g != null && g.Length > 0)
diff --git a/mcs/tests/test-xml-053-ref.xml b/mcs/tests/test-xml-053-ref.xml
new file mode 100644
index 0000000..70612af
--- /dev/null
+++ b/mcs/tests/test-xml-053-ref.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>test-xml-053</name>
+ </assembly>
+ <members>
+ <member name="T:Outer`2">
+ <summary>T:Outer`2</summary>
+ </member>
+ <member name="T:Outer`2.Inner`1">
+ <summary>T:Outer`2:Inner`1</summary>
+ </member>
+ <member name="M:Outer`2.Inner`1.Bar(`0@,`1,`2)">
+ <summary>M:Outer`2.Inner`1.Bar(`0@,`1,`2)</summary>
+ </member>
+ <member name="M:Outer`2.CopyTo(`0[],System.Int32)">
+ <summary>M:Outer`2.CopyTo(`0[],System.Int32)</summary>
+ </member>
+ <member name="M:Outer`2.CopyTo(`0[,,],System.Int32)">
+ <summary>M:Outer`2.CopyTo(`0[,,],System.Int32)</summary>
+ </member>
+ <member name="M:Outer`2.CopyTo(`0[,,][,][])">
+ <summary>M:Outer`2.CopyTo(`0[,,][,][])</summary>
+ </member>
+ <member name="M:Outer`2.CopyTo(System.Collections.Generic.KeyValuePair{`0,System.Collections.Generic.List{`1}}[],System.Int32)">
+ <summary>M:Outer`2.CopyTo(System.Collections.Generic.KeyValuePair{`0,System.Collections.Generic.List{`1}}[],System.Int32)</summary>
+ </member>
+ <member name="M:Outer`2.CopyTo``2(System.Collections.Generic.KeyValuePair{``0,System.Collections.Generic.List{``1}}[],System.Int32)">
+ <summary>M:Outer`2.CopyTo``2(System.Collections.Generic.KeyValuePair{``0,System.Collections.Generic.List{``1}}[],System.Int32)</summary>
+ </member>
+ <member name="M:Outer`2.CopyTo``1(System.Collections.Generic.KeyValuePair{`1,System.Collections.Generic.List{``0}}[],System.Int32)">
+ <summary>M:Outer`2.CopyTo``1(System.Collections.Generic.KeyValuePair{`1,System.Collections.Generic.List{``0}}[],System.Int32)</summary>
+ </member>
+ <member name="M:Outer`2.Foo``1(``0[])">
+ <summary>M:Outer`2.Foo``1(``0[])</summary>
+ </member>
+ <member name="M:Outer`2.Foo``1(``0[],`0)">
+ <summary>M:Outer`2.Foo``1(``0[],`0)</summary>
+ </member>
+ <member name="T:Util">
+ <summary>T:Util</summary>
+ </member>
+ <member name="M:Util.Convert``2(``1[])">
+ <summary>M:Util.Convert``2(``1[])</summary>
+ </member>
+ </members>
+</doc>
diff --git a/mcs/tests/test-xml-053.cs b/mcs/tests/test-xml-053.cs
new file mode 100644
index 0000000..b402e5e
--- /dev/null
+++ b/mcs/tests/test-xml-053.cs
@@ -0,0 +1,71 @@
+// Compiler options: -doc:xml-053.xml
+
+/// <summary>T:Outer`2</summary>
+public class Outer<T, U> {
+ /// <summary>M:Outer`2.CopyTo(`0[],System.Int32)</summary>
+ public void CopyTo(T[] array, int n)
+ {
+ }
+
+ /// <summary>M:Outer`2.CopyTo(`0[,,],System.Int32)</summary>
+ public void CopyTo(T[,,] array, int n)
+ {
+ }
+
+ /// <summary>M:Outer`2.CopyTo(`0[,,][,][])</summary>
+ public void CopyTo(T[][,][,,] array)
+ {
+ }
+
+ /// <summary>M:Outer`2.CopyTo(System.Collections.Generic.KeyValuePair{`0,System.Collections.Generic.List{`1}}[],System.Int32)</summary>
+ public void CopyTo(System.Collections.Generic.KeyValuePair<T,System.Collections.Generic.List<U>>[] array, int n)
+ {
+ }
+
+ /// <summary>M:Outer`2.CopyTo``2(System.Collections.Generic.KeyValuePair{``0,System.Collections.Generic.List{``1}}[],System.Int32)</summary>
+ public void CopyTo<W,X>(System.Collections.Generic.KeyValuePair<W,System.Collections.Generic.List<X>>[] array, int n)
+ {
+ }
+
+ /// <summary>M:Outer`2.CopyTo``1(System.Collections.Generic.KeyValuePair{`1,System.Collections.Generic.List{``0}}[],System.Int32)</summary>
+ public void CopyTo<V>(System.Collections.Generic.KeyValuePair<U,System.Collections.Generic.List<V>>[] array, int n)
+ {
+ }
+
+ /// <summary>M:Outer`2.Foo``1(``0[])</summary>
+ public void Foo<T>(T[] array)
+ {
+ }
+
+ /// <summary>M:Outer`2.Foo``1(``0[],`0)</summary>
+ public void Foo<S>(S[] array, T value)
+ {
+ }
+
+ /// <summary>T:Outer`2:Inner`1</summary>
+ public class Inner<V> {
+ /// <summary>M:Outer`2.Inner`1.Bar(`0@,`1,`2)</summary>
+ public static void Bar(ref T t, U u, V v)
+ {
+ }
+ }
+}
+
+/// <summary>T:Util</summary>
+public class Util {
+ // from #624242
+
+ /// <summary>M:Util.Convert``2(``1[])</summary>
+ public static TResult Convert<TResult,TSource>(TSource[] input)
+ where TResult : TSource
+ {
+ return default (TResult);
+ }
+}
+
+class Test {
+ public static void Main ()
+ {
+ }
+}
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment