From e3a3a7ec33d0067e3c6a0592c283ca44211d178b Mon Sep 17 00:00:00 2001 From: yoyobbi Date: Mon, 25 Apr 2016 22:40:35 -0700 Subject: [PATCH] fix: multi-dimensional arrays sometimes working fix: use of tabs in samples C# file TODO: multi-dimensional arrays not always with overloaded methods - is there a bug in the navigateTo implementation? --- ILSpy.AddIn/CodeElementXmlDocKeyProvider.cs | 34 +- ILSpy.AddIn/Samples/ILSpyAddInSamples.cs | 789 ++++++++++---------- 2 files changed, 407 insertions(+), 416 deletions(-) diff --git a/ILSpy.AddIn/CodeElementXmlDocKeyProvider.cs b/ILSpy.AddIn/CodeElementXmlDocKeyProvider.cs index 54dca7ef4..81dafc36b 100644 --- a/ILSpy.AddIn/CodeElementXmlDocKeyProvider.cs +++ b/ILSpy.AddIn/CodeElementXmlDocKeyProvider.cs @@ -109,7 +109,6 @@ namespace ICSharpCode.ILSpy.AddIn b.Append(')'); } if (explicitReturnType != null) { - // TODO: test explicit return types b.Append('~'); AppendTypeName(b, explicitReturnType.AsFullName, true, false); } @@ -177,12 +176,11 @@ namespace ICSharpCode.ILSpy.AddIn { EnvDTE80.CodeTypeRef2 parameterTypeRef = (EnvDTE80.CodeTypeRef2)parameter.Type; string parameterTypeString = parameterTypeRef.AsFullName; - if (parameterTypeRef.TypeKind == EnvDTE.vsCMTypeRef.vsCMTypeRefArray) { - parameterTypeString = parameterTypeRef.ElementType.AsFullName; - } + int substringStart = 0; for (int i = 0; i < parameterTypeString.Length; ++i) { - switch (parameterTypeString[i]) { + char ch = parameterTypeString[i]; + switch (ch) { case '<': AppendParameterTypeSubstring(b, parameterTypeString, substringStart, i, genericTypeParameters, genericMethodParameters); substringStart = i + 1; @@ -193,42 +191,30 @@ namespace ICSharpCode.ILSpy.AddIn substringStart = i + 1; b.Append('}'); break; + case '[': + case ']': case ',': AppendParameterTypeSubstring(b, parameterTypeString, substringStart, i, genericTypeParameters, genericMethodParameters); substringStart = i + 1; // Skip space after comma if present. - if (parameterTypeString[substringStart] == ' ') { + if ((substringStart < parameterTypeString.Length) && (parameterTypeString[substringStart] == ' ')) { ++substringStart; } - b.Append(','); + b.Append(ch); break; } } AppendParameterTypeSubstring(b, parameterTypeString, substringStart, parameterTypeString.Length, genericTypeParameters, genericMethodParameters); - if (parameterTypeRef.TypeKind == EnvDTE.vsCMTypeRef.vsCMTypeRefArray) { - b.Append('['); - for (int i = 0; i < parameterTypeRef.Rank; i++) { - if (i > 0) - b.Append(','); - // TODO: how to get array bounds from EnvDTE code model? - //ArrayDimension ad = arrayType.Dimensions[i]; - //if (ad.IsSized) { - // b.Append(ad.LowerBound); - // b.Append(':'); - // b.Append(ad.UpperBound); - //} - } - b.Append(']'); - } - // Append ref / out indicator if needed. - // Note there is no need to append a '*' for pointers, as this is included in the full name of the type. if ((parameter.ParameterKind == EnvDTE80.vsCMParameterKind.vsCMParameterKindRef) || (parameter.ParameterKind == EnvDTE80.vsCMParameterKind.vsCMParameterKindOut)) { b.Append('@'); } + + // Note there is no need to append a '*' for pointers, as this is included in the full name of the type. + // Multi-dimensional and nested arrays are also captured in the full name of the type. } private static void AppendParameterTypeSubstring(StringBuilder b, string parameterTypeString, int substringStart, int substringStop, string[] genericTypeParameters, string[] genericMethodParameters) diff --git a/ILSpy.AddIn/Samples/ILSpyAddInSamples.cs b/ILSpy.AddIn/Samples/ILSpyAddInSamples.cs index fc85a3462..803b3bfc4 100644 --- a/ILSpy.AddIn/Samples/ILSpyAddInSamples.cs +++ b/ILSpy.AddIn/Samples/ILSpyAddInSamples.cs @@ -14,402 +14,407 @@ using System.Collections.Generic; // N:ILSpy.AddIn.Tests namespace ILSpy.AddIn.Tests { - // T:ILSpy.AddIn.Tests.SomeClass - public class SomeClass - { - // E:ILSpy.AddIn.Tests.SomeClass.OnEvent - public event Action OnEvent; - - // F:ILSpy.AddIn.Tests.SomeClass.mField - private int mField; - - // P:ILSpy.AddIn.Tests.SomeClass.Property - private int Property - { - get - { - return mField; - } - set - { - mField = value; - } - } - - // P:ILSpy.AddIn.Tests.SomeClass.Item(System.Int32,System.Int32) - public int this[int x, int y] - { - get { return x + y + mField; } - } - - // M:ILSpy.AddIn.Tests.SomeClass.#ctor - public SomeClass() - { - mField = 0; - } - - // M:ILSpy.AddIn.Tests.SomeClass.#ctor(System.Int32) - public SomeClass(int x) - { - mField = x; - } - - // M:ILSpy.AddIn.Tests.SomeClass.#ctor(System.Int32,System.Int32) - public SomeClass(int x, int y) - { - mField = x + y; - } - - // M:ILSpy.AddIn.Tests.SomeClass.Method - public int Method() - { - return mField; - } - - // M:ILSpy.AddIn.Tests.SomeClass.MethodWithGenericParameter(System.IEquatable{System.String}) - public void MethodWithGenericParameter(IEquatable x) - { - - } - - // M:ILSpy.AddIn.Tests.SomeClass.MethodWithGenericParameter(System.IEquatable{System.String},System.Int32) - public void MethodWithGenericParameter(IEquatable x, int y) - { - - } - - // M:ILSpy.AddIn.Tests.SomeClass.GenericMethod``1(``0) - public int GenericMethod(T x) - { - return mField + x.GetHashCode(); - } - - // M:ILSpy.AddIn.Tests.SomeClass.GenericOverloadedMethod``1(System.Int32,``0) - public int GenericOverloadedMethod(int x, T1 y) - { - return mField + x + y.GetHashCode(); - } - - // M:ILSpy.AddIn.Tests.SomeClass.GenericOverloadedMethod``2(System.Int32,``0,``1) - public int GenericOverloadedMethod(int x, T1 y, T2 z) - { - return mField + x + y.GetHashCode() + z.GetHashCode(); - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedMethod - public int OverloadedMethod() - { - return mField * mField; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedMethod(System.Int32) - public int OverloadedMethod(int m) - { - return mField * m; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedMethod(System.Int32,System.Int32) - public int OverloadedMethod(int m1, int m2) - { - return mField * m1 * m2; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1 - public int OverloadedGenericMethod() - { - return mField * mField; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32) - public int OverloadedGenericMethod(int m) - { - return mField * m; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32,System.Int32) - public int OverloadedGenericMethod(int m1, int m2) - { - return mField * m1 * m2; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32,System.Int32,System.Collections.IEnumerable) - public int OverloadedGenericMethod(int m1, int m2, IEnumerable m3) - { - return mField * m1 * m2; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32,System.Int32,System.Collections.Generic.IEnumerable{``0}) - public int OverloadedGenericMethod(int m1, int m2, IEnumerable m3) - { - return mField * m1 * m2; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32,System.Int32,System.Collections.Generic.IEnumerable{System.String}) - public int OverloadedGenericMethod(int m1, int m2, IEnumerable m3) - { - return mField * m1 * m2; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Collections.Generic.IEnumerable{System.Collections.Generic.IEnumerable{ILSpy.AddIn.Tests.SomeGenericClass{System.String,``0}}}) - public int OverloadedGenericMethod(IEnumerable>> m3) - { - return mField; - } - - // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(ILSpy.AddIn.Tests.SomeGenericClass{``0,ILSpy.AddIn.Tests.SomeGenericClass{``0,``0}}.NestedGeneric{System.String,``0}) - public void OverloadedGenericMethod(SomeGenericClass>.NestedGeneric wow) - { - } - - // T:ILSpy.AddIn.Tests.SomeClass.NestedEnum - public enum NestedEnum - { - // F:ILSpy.AddIn.Tests.SomeClass.NestedEnum.First - First = 1, - Second = 2, - Third = 3 - } - - // T:ILSpy.AddIn.Tests.SomeClass.NestedInterface - public interface NestedInterface - { - // P:ILSpy.AddIn.Tests.SomeClass.NestedInterface.SomeProperty - int SomeProperty { get; } - - // M:ILSpy.AddIn.Tests.SomeClass.NestedInterface.SomeMethod - int SomeMethod(); - } - - // T:ILSpy.AddIn.Tests.SomeClass.NestedClass - public class NestedClass : NestedInterface - { - // F:ILSpy.AddIn.Tests.SomeClass.NestedClass.mX - private int mX; - - // M:ILSpy.AddIn.Tests.SomeClass.NestedClass.#ctor(System.Int32) - public NestedClass(int x) - { - mX = x; - } - - // M:ILSpy.AddIn.Tests.SomeClass.NestedClass.#ctor(ILSpy.AddIn.Tests.SomeClass.NestedEnum) - public NestedClass(NestedEnum x) - { - mX = (int)x; - } - - // P:ILSpy.AddIn.Tests.SomeClass.NestedClass.SomeProperty - public int SomeProperty - { - get { return mX; } - } - - // M:ILSpy.AddIn.Tests.SomeClass.NestedClass.SomeMethod - public int SomeMethod() - { - return mX * mX; - } - } - - // T:ILSpy.AddIn.Tests.SomeClass.NestedStruct - public struct NestedStruct : NestedInterface - { - // F:ILSpy.AddIn.Tests.SomeClass.NestedStruct.X - public int X; - // F:ILSpy.AddIn.Tests.SomeClass.NestedStruct.Y - public int Y; - - // P:ILSpy.AddIn.Tests.SomeClass.NestedStruct.SomeProperty - public int SomeProperty - { - get { return X + Y; } - } - - // M:ILSpy.AddIn.Tests.SomeClass.NestedStruct.SomeMethod - public int SomeMethod() - { - return X * Y; - } - } - } - - // T:ILSpy.AddIn.Tests.SomeGenericClass`2 - public class SomeGenericClass - { - // F:ILSpy.AddIn.Tests.SomeGenericClass`2.mField1 - T1 mField1; - // F:ILSpy.AddIn.Tests.SomeGenericClass`2.mField2 - T2 mField2; - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.#ctor(`0,`1) - public SomeGenericClass(T1 a, T2 b) - { - mField1 = a; - mField2 = b; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.#ctor(`0) - public SomeGenericClass(T1 a) - { - mField1 = a; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.#ctor - public SomeGenericClass() - { - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.Finalize - ~SomeGenericClass() - { - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(`0,`1) - public void GenericClassMethod(T1 a, T2 b) - { - mField1 = a; - mField2 = b; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(System.Int32*) - unsafe public void GenericClassMethod(int* x) - { - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(System.Int32*[]) - unsafe public void GenericClassMethod(int*[] x) - { - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(`0[]@) - unsafe public void GenericClassMethod(out T1[] x) - { - x = null; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(System.Int32@) - public void GenericClassMethod(ref int a) - { - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``1(``0@) - public T3 GenericClassGenericMethod(ref T3 x) - { - return x; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``1 - public T3 GenericClassGenericMethod() - { - return default(T3); - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``1(System.Int32) - public void GenericClassGenericMethod(int x) - { - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(`0,``1,System.Int32,`1@) - public T4 GenericClassGenericMethod(T1 x, T4 y, int z, out T2 result) - { - mField1 = x; - string foo = y.ToString() + z.ToString(); - result = mField2; - return y; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(`0,``0,System.Int32[]) - public T3 GenericClassGenericMethod(T1 x, T3 y, int[] z) - { - mField1 = x; - string foo = y.ToString() + z.ToString(); - return y; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.ArrayMethod(`0[],System.Int32[]) - public void ArrayMethod(T1[] x, int[] y) - { - } - - // NOT? M:ILSpy.AddIn.Tests.SomeGenericClass`2.ArrayMethod(`0[,],System.Int32[,]) - public void ArrayMethod(T1[,] x, int[,] y) - { - } - - // NOT! M:ILSpy.AddIn.Tests.SomeGenericClass`2.ArrayMethod([],[]) - public void ArrayMethod(T1[][] x, int[][] y) - { - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(`0,``0,ILSpy.AddIn.Tests.SomeClass) - public T3 GenericClassGenericMethod(T1 x, T3 y, SomeClass z) - { - mField1 = x; - string foo = y.ToString() + z.ToString(); - return y; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(`0,``0,ILSpy.AddIn.Tests.SomeClass[]@) - public T3 GenericClassGenericMethod(T1 x, T3 y, out SomeClass[] z) - { - mField1 = x; - z = null; - string foo = y.ToString() + z.ToString(); - return y; - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(System.Int32[],ILSpy.AddIn.Tests.SomeGenericClass{``0,``1}) - public void GenericClassGenericMethod(int[] x, SomeGenericClass y) - { - string foo = x.ToString() + y.ToString(); - } - - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.op_Addition(ILSpy.AddIn.Tests.SomeGenericClass{`0,`1},ILSpy.AddIn.Tests.SomeGenericClass{`0,`1}) - public static SomeGenericClass operator +(SomeGenericClass a, SomeGenericClass b) - { - return new SomeGenericClass(); - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.op_Explicit(ILSpy.AddIn.Tests.SomeGenericClass{`0,`1})~ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2 - public static explicit operator NestedGeneric(SomeGenericClass sgc) - { - return new NestedGeneric(); - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.op_Implicit(ILSpy.AddIn.Tests.SomeGenericClass{`0,`1})~ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2 - public static implicit operator NestedGeneric(SomeGenericClass sgc) - { - return new NestedGeneric(); - } - - // T:ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2 - public class NestedGeneric - { - // T:ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2.NestedDelegate - public delegate int NestedDelegate(T3 x, IEnumerable y); - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2.NestedGenericMethod``1(`0,``0) - public void NestedGenericMethod(T1 x, T5 y) - { - } - - // M:ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2.NestedGenericMethod``3(`0,`3,``0[],System.Collections.Generic.IEnumerable{``2}) - public void NestedGenericMethod(T1 x, T4 y, T5[] z, IEnumerable w) - { - } - } - } + // T:ILSpy.AddIn.Tests.SomeClass + public class SomeClass + { + // E:ILSpy.AddIn.Tests.SomeClass.OnEvent + public event Action OnEvent; + + // F:ILSpy.AddIn.Tests.SomeClass.mField + private int mField; + + // P:ILSpy.AddIn.Tests.SomeClass.Property + private int Property + { + get + { + return mField; + } + set + { + mField = value; + } + } + + // P:ILSpy.AddIn.Tests.SomeClass.Item(System.Int32,System.Int32) + public int this[int x, int y] + { + get { return x + y + mField; } + } + + // M:ILSpy.AddIn.Tests.SomeClass.#ctor + public SomeClass() + { + mField = 0; + } + + // M:ILSpy.AddIn.Tests.SomeClass.#ctor(System.Int32) + public SomeClass(int x) + { + mField = x; + } + + // M:ILSpy.AddIn.Tests.SomeClass.#ctor(System.Int32,System.Int32) + public SomeClass(int x, int y) + { + mField = x + y; + } + + // M:ILSpy.AddIn.Tests.SomeClass.Method + public int Method() + { + return mField; + } + + // M:ILSpy.AddIn.Tests.SomeClass.MethodWithGenericParameter(System.IEquatable{System.String}) + public void MethodWithGenericParameter(IEquatable x) + { + + } + + // M:ILSpy.AddIn.Tests.SomeClass.MethodWithGenericParameter(System.IEquatable{System.String},System.Int32) + public void MethodWithGenericParameter(IEquatable x, int y) + { + + } + + // M:ILSpy.AddIn.Tests.SomeClass.GenericMethod``1(``0) + public int GenericMethod(T x) + { + return mField + x.GetHashCode(); + } + + // M:ILSpy.AddIn.Tests.SomeClass.GenericOverloadedMethod``1(System.Int32,``0) + public int GenericOverloadedMethod(int x, T1 y) + { + return mField + x + y.GetHashCode(); + } + + // M:ILSpy.AddIn.Tests.SomeClass.GenericOverloadedMethod``2(System.Int32,``0,``1) + public int GenericOverloadedMethod(int x, T1 y, T2 z) + { + return mField + x + y.GetHashCode() + z.GetHashCode(); + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedMethod + public int OverloadedMethod() + { + return mField * mField; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedMethod(System.Int32) + public int OverloadedMethod(int m) + { + return mField * m; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedMethod(System.Int32,System.Int32) + public int OverloadedMethod(int m1, int m2) + { + return mField * m1 * m2; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1 + public int OverloadedGenericMethod() + { + return mField * mField; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32) + public int OverloadedGenericMethod(int m) + { + return mField * m; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32,System.Int32) + public int OverloadedGenericMethod(int m1, int m2) + { + return mField * m1 * m2; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32,System.Int32,System.Collections.IEnumerable) + public int OverloadedGenericMethod(int m1, int m2, IEnumerable m3) + { + return mField * m1 * m2; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32,System.Int32,System.Collections.Generic.IEnumerable{``0}) + public int OverloadedGenericMethod(int m1, int m2, IEnumerable m3) + { + return mField * m1 * m2; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Int32,System.Int32,System.Collections.Generic.IEnumerable{System.String}) + public int OverloadedGenericMethod(int m1, int m2, IEnumerable m3) + { + return mField * m1 * m2; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(System.Collections.Generic.IEnumerable{System.Collections.Generic.IEnumerable{ILSpy.AddIn.Tests.SomeGenericClass{System.String,``0}}}) + public int OverloadedGenericMethod(IEnumerable>> m3) + { + return mField; + } + + // M:ILSpy.AddIn.Tests.SomeClass.OverloadedGenericMethod``1(ILSpy.AddIn.Tests.SomeGenericClass{``0,ILSpy.AddIn.Tests.SomeGenericClass{``0,``0}}.NestedGeneric{System.String,``0}) + public void OverloadedGenericMethod(SomeGenericClass>.NestedGeneric wow) + { + } + + // T:ILSpy.AddIn.Tests.SomeClass.NestedEnum + public enum NestedEnum + { + // F:ILSpy.AddIn.Tests.SomeClass.NestedEnum.First + First = 1, + Second = 2, + Third = 3 + } + + // T:ILSpy.AddIn.Tests.SomeClass.NestedInterface + public interface NestedInterface + { + // P:ILSpy.AddIn.Tests.SomeClass.NestedInterface.SomeProperty + int SomeProperty { get; } + + // M:ILSpy.AddIn.Tests.SomeClass.NestedInterface.SomeMethod + int SomeMethod(); + } + + // T:ILSpy.AddIn.Tests.SomeClass.NestedClass + public class NestedClass : NestedInterface + { + // F:ILSpy.AddIn.Tests.SomeClass.NestedClass.mX + private int mX; + + // M:ILSpy.AddIn.Tests.SomeClass.NestedClass.#ctor(System.Int32) + public NestedClass(int x) + { + mX = x; + } + + // M:ILSpy.AddIn.Tests.SomeClass.NestedClass.#ctor(ILSpy.AddIn.Tests.SomeClass.NestedEnum) + public NestedClass(NestedEnum x) + { + mX = (int)x; + } + + // P:ILSpy.AddIn.Tests.SomeClass.NestedClass.SomeProperty + public int SomeProperty + { + get { return mX; } + } + + // M:ILSpy.AddIn.Tests.SomeClass.NestedClass.SomeMethod + public int SomeMethod() + { + return mX * mX; + } + } + + // T:ILSpy.AddIn.Tests.SomeClass.NestedStruct + public struct NestedStruct : NestedInterface + { + // F:ILSpy.AddIn.Tests.SomeClass.NestedStruct.X + public int X; + // F:ILSpy.AddIn.Tests.SomeClass.NestedStruct.Y + public int Y; + + // P:ILSpy.AddIn.Tests.SomeClass.NestedStruct.SomeProperty + public int SomeProperty + { + get { return X + Y; } + } + + // M:ILSpy.AddIn.Tests.SomeClass.NestedStruct.SomeMethod + public int SomeMethod() + { + return X * Y; + } + } + } + + // T:ILSpy.AddIn.Tests.SomeGenericClass`2 + public class SomeGenericClass + { + // F:ILSpy.AddIn.Tests.SomeGenericClass`2.mField1 + T1 mField1; + // F:ILSpy.AddIn.Tests.SomeGenericClass`2.mField2 + T2 mField2; + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.#ctor(`0,`1) + public SomeGenericClass(T1 a, T2 b) + { + mField1 = a; + mField2 = b; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.#ctor(`0) + public SomeGenericClass(T1 a) + { + mField1 = a; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.#ctor + public SomeGenericClass() + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.Finalize + ~SomeGenericClass() + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(`0,`1) + public void GenericClassMethod(T1 a, T2 b) + { + mField1 = a; + mField2 = b; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(System.Int32*) + unsafe public void GenericClassMethod(int* x) + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(System.Int32*[]) + unsafe public void GenericClassMethod(int*[] x) + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(`0[]@) + unsafe public void GenericClassMethod(out T1[] x) + { + x = null; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassMethod(System.Int32@) + public void GenericClassMethod(ref int a) + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``1(``0@) + public T3 GenericClassGenericMethod(ref T3 x) + { + return x; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``1 + public T3 GenericClassGenericMethod() + { + return default(T3); + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``1(System.Int32) + public void GenericClassGenericMethod(int x) + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(`0,``1,System.Int32,`1@) + public T4 GenericClassGenericMethod(T1 x, T4 y, int z, out T2 result) + { + mField1 = x; + string foo = y.ToString() + z.ToString(); + result = mField2; + return y; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(`0,``0,System.Int32[]) + public T3 GenericClassGenericMethod(T1 x, T3 y, int[] z) + { + mField1 = x; + string foo = y.ToString() + z.ToString(); + return y; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.ArrayMethod(`0[],System.Int32[]) + public void ArrayMethod(T1[] x, int[] y) + { + } + + // NOT? M:ILSpy.AddIn.Tests.SomeGenericClass`2.ArrayMethod(`0[,],System.Int32[,]) + public void ArrayMethod(T1[,] x, int[,] y) + { + } + + // NOT? M:ILSpy.AddIn.Tests.SomeGenericClass`2.ArrayMethod(System.Int32[,],System.Int32[,]) + public void ArrayMethod(int[,] x, int[,] y) + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.ArrayMethod(`0[][],System.Int32[][]) + public void ArrayMethod(T1[][] x, int[][] y) + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(`0,``0,ILSpy.AddIn.Tests.SomeClass) + public T3 GenericClassGenericMethod(T1 x, T3 y, SomeClass z) + { + mField1 = x; + string foo = y.ToString() + z.ToString(); + return y; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(`0,``0,ILSpy.AddIn.Tests.SomeClass[]@) + public T3 GenericClassGenericMethod(T1 x, T3 y, out SomeClass[] z) + { + mField1 = x; + z = null; + string foo = y.ToString() + z.ToString(); + return y; + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.GenericClassGenericMethod``2(System.Int32[],ILSpy.AddIn.Tests.SomeGenericClass{``0,``1}) + public void GenericClassGenericMethod(int[] x, SomeGenericClass y) + { + string foo = x.ToString() + y.ToString(); + } + + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.op_Addition(ILSpy.AddIn.Tests.SomeGenericClass{`0,`1},ILSpy.AddIn.Tests.SomeGenericClass{`0,`1}) + public static SomeGenericClass operator +(SomeGenericClass a, SomeGenericClass b) + { + return new SomeGenericClass(); + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.op_Explicit(ILSpy.AddIn.Tests.SomeGenericClass{`0,`1})~ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2 + public static explicit operator NestedGeneric(SomeGenericClass sgc) + { + return new NestedGeneric(); + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.op_Implicit(ILSpy.AddIn.Tests.SomeGenericClass{`0,`1})~ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2 + public static implicit operator NestedGeneric(SomeGenericClass sgc) + { + return new NestedGeneric(); + } + + // T:ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2 + public class NestedGeneric + { + // T:ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2.NestedDelegate + public delegate int NestedDelegate(T3 x, IEnumerable y); + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2.NestedGenericMethod``1(`0,``0) + public void NestedGenericMethod(T1 x, T5 y) + { + } + + // M:ILSpy.AddIn.Tests.SomeGenericClass`2.NestedGeneric`2.NestedGenericMethod``3(`0,`3,``0[],System.Collections.Generic.IEnumerable{``2}) + public void NestedGenericMethod(T1 x, T4 y, T5[] z, IEnumerable w) + { + } + } + } } // T:SpaceFreeClass class SpaceFreeClass { - // F:SpaceFreeClass.mField - int mField; + // F:SpaceFreeClass.mField + int mField; - // M:SpaceFreeClass.Method - private void Method() - { - } + // M:SpaceFreeClass.Method + private void Method() + { + } }