Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbevain <jbevain@gmail.com>2010-07-22 00:54:26 +0400
committerjbevain <jbevain@gmail.com>2010-07-22 00:54:26 +0400
commitc3872a636f773b4e85ac86cfb78a32e2e5401443 (patch)
tree3522bb56838d58683039aa7712d674fc6fa20764
parent8d5e6dcf4de42d827c198238b6d644417f722679 (diff)
fix IGenericContext.Type for method on a generic instance
-rw-r--r--Mono.Cecil/MethodReference.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Mono.Cecil/MethodReference.cs b/Mono.Cecil/MethodReference.cs
index 0c7dab7..e5a1ebe 100644
--- a/Mono.Cecil/MethodReference.cs
+++ b/Mono.Cecil/MethodReference.cs
@@ -72,7 +72,14 @@ namespace Mono.Cecil {
}
IGenericParameterProvider IGenericContext.Type {
- get { return DeclaringType; }
+ get {
+ var declaring_type = this.DeclaringType;
+ var instance = declaring_type as GenericInstanceType;
+ if (instance != null)
+ return instance.ElementType;
+
+ return declaring_type;
+ }
}
IGenericParameterProvider IGenericContext.Method {