Permalink
Browse files

Let people change the scope of a reference, why not?

  • Loading branch information...
1 parent aea2ceb commit 245e3cbbbdf4fc4824958d661a68cb1bd1be82f0 @jbevain committed Aug 10, 2012
Showing with 10 additions and 1 deletion.
  1. +1 −1 Mono.Cecil/AssemblyReader.cs
  2. +9 −0 Mono.Cecil/TypeReference.cs
@@ -782,7 +782,7 @@ public Collection<TypeDefinition> ReadNestedTypes (TypeDefinition type)
var nested_type = GetTypeDefinition (mapping [i]);
if (nested_type != null)
- nested_types.Add (nested_type);
+ nested_types.Add (nested_type);
}
metadata.RemoveNestedTypeMapping (type);
@@ -147,6 +147,15 @@ public class TypeReference : MemberReference, IGenericParameterProvider, IGeneri
return scope;
}
+ set {
+ var declaring_type = this.DeclaringType;
+ if (declaring_type != null) {
+ declaring_type.Scope = value;
+ return;
+ }
+
+ scope = value;
+ }
}
public bool IsNested {

0 comments on commit 245e3cb

Please sign in to comment.