diff options
author | Daniel Grunwald <daniel@danielgrunwald.de> | 2014-08-10 14:44:25 +0400 |
---|---|---|
committer | Daniel Grunwald <daniel@danielgrunwald.de> | 2014-08-10 14:44:25 +0400 |
commit | ccecc31466e652f70cc4dbefabe7914c7c73f6cd (patch) | |
tree | 6a931967e5fd13e985d02cb947d304eaba85ee73 | |
parent | a044267d61acc263012670c0489154601c7b1a63 (diff) |
Revert GetClassTypeReference changes in 5118b41d36 (and following)
-rw-r--r-- | ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs b/ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs index 4a717bed..3624da89 100644 --- a/ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs +++ b/ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs @@ -89,28 +89,6 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation [Obsolete("Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.")] public int TypeParameterCount { get { return fullTypeName.TypeParameterCount; } } - [NonSerialized] - int flags; - const int AlreadyTriedToLookupInDifferentAssemblyFlag = 1; - - IType ResolveUsingTypeContext (ITypeResolveContext context) - { - IType type = null; - - if (context.CurrentAssembly != null) { - type = context.CurrentAssembly.GetTypeDefinition (fullTypeName); - } - if (type == null) { - var compilation = context.Compilation; - foreach (var asm in compilation.Assemblies) { - type = asm.GetTypeDefinition (fullTypeName); - if (type != null) - break; - } - } - return type; - } - public IType Resolve(ITypeResolveContext context) { if (context == null) @@ -118,18 +96,23 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation IType type = null; if (assembly == null) { - type = ResolveUsingTypeContext (context); + if (context.CurrentAssembly != null) { + type = context.CurrentAssembly.GetTypeDefinition(fullTypeName); + } + if (type == null) { + var compilation = context.Compilation; + foreach (var asm in compilation.Assemblies) { + type = asm.GetTypeDefinition(fullTypeName); + if (type != null) + break; + } + } } else { IAssembly asm = assembly.Resolve(context); if (asm != null) { type = asm.GetTypeDefinition(fullTypeName); } - - if ((Interlocked.Exchange (ref flags, flags | AlreadyTriedToLookupInDifferentAssemblyFlag) & AlreadyTriedToLookupInDifferentAssemblyFlag) == 0) { - type = ResolveUsingTypeContext (context); - } } - return type ?? new UnknownType(fullTypeName); } |