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

github.com/xamarin/NRefactory.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Grunwald <daniel@danielgrunwald.de>2015-05-30 12:57:23 +0300
committerDaniel Grunwald <daniel@danielgrunwald.de>2015-05-30 13:16:22 +0300
commit530d5b583fc378f98dd27e42067bfdef77b350da (patch)
treed0c8a0c8817a9bd5bb51dec845cc0bfae30e8936 /ICSharpCode.NRefactory.Cecil
parente2f72129355af155048ba5a36439f25c01010618 (diff)
Merge changes from ILSpy newdecompiler branch
Diffstat (limited to 'ICSharpCode.NRefactory.Cecil')
-rw-r--r--ICSharpCode.NRefactory.Cecil/CecilLoader.cs17
1 files changed, 15 insertions, 2 deletions
diff --git a/ICSharpCode.NRefactory.Cecil/CecilLoader.cs b/ICSharpCode.NRefactory.Cecil/CecilLoader.cs
index 29850ed3..f7575823 100644
--- a/ICSharpCode.NRefactory.Cecil/CecilLoader.cs
+++ b/ICSharpCode.NRefactory.Cecil/CecilLoader.cs
@@ -32,6 +32,8 @@ using Mono.Cecil;
namespace ICSharpCode.NRefactory.TypeSystem
{
+ using BlobReader = ICSharpCode.NRefactory.TypeSystem.Implementation.BlobReader;
+
/// <summary>
/// Allows loading an IProjectContent from an already compiled assembly.
/// </summary>
@@ -64,7 +66,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
/// If you access the Cecil objects directly in your application, you may need to take the same lock.
/// </remarks>
public bool LazyLoad { get; set; }
-
+
/// <summary>
/// This delegate gets executed whenever an entity was loaded.
/// </summary>
@@ -425,7 +427,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
return false;
}
#endregion
-
+
#region Read Attributes
#region Assembly Attributes
static readonly ITypeReference assemblyVersionAttributeTypeRef = typeof(System.Reflection.AssemblyVersionAttribute).ToTypeReference();
@@ -724,6 +726,15 @@ namespace ICSharpCode.NRefactory.TypeSystem
}
#endregion
+ #region Type Parameter Attributes
+ void AddAttributes(GenericParameter genericParameter, IUnresolvedTypeParameter targetTP)
+ {
+ if (genericParameter.HasCustomAttributes) {
+ AddCustomAttributes(genericParameter.CustomAttributes, targetTP.Attributes);
+ }
+ }
+ #endregion
+
#region MarshalAsAttribute (ConvertMarshalInfo)
static readonly ITypeReference marshalAsAttributeTypeRef = typeof(MarshalAsAttribute).ToTypeReference();
static readonly ITypeReference unmanagedTypeTypeRef = typeof(UnmanagedType).ToTypeReference();
@@ -864,6 +875,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
for (int i = 0; i < typeParameters.Count; i++) {
var tp = (DefaultUnresolvedTypeParameter)typeParameters[i];
AddConstraints(tp, typeDefinition.GenericParameters[i]);
+ AddAttributes(typeDefinition.GenericParameters[i], tp);
tp.ApplyInterningProvider(interningProvider);
}
}
@@ -1330,6 +1342,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
for (int i = 0; i < method.GenericParameters.Count; i++) {
var tp = (DefaultUnresolvedTypeParameter)m.TypeParameters[i];
AddConstraints(tp, method.GenericParameters[i]);
+ AddAttributes(method.GenericParameters[i], tp);
tp.ApplyInterningProvider(interningProvider);
}
}