Fixed type lookup in GetClassTypReference.

Mixed normal/portal assemblies make that necessary.
This commit is contained in:
Mike Krüger 2014-08-05 18:06:14 +02:00
Родитель 8e4cae8ae5
Коммит 5118b41d36
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -98,20 +98,20 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
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 (type == null) {
var compilation = context.Compilation;
foreach (var asm in compilation.Assemblies) {
type = asm.GetTypeDefinition(fullTypeName);
if (type != null)
break;
}
}
return type ?? new UnknownType(fullTypeName);
}