A generic type instance is loaded by the assembly class loader of the generic type definition, but it should not be registered there (as this causes name clashes and that class loader isn't reported as it's loader anyway), it should be registered by the generic class loader that it is associated with.

This commit is contained in:
jfrijters 2010-05-10 04:45:49 +00:00
Родитель 07406738df
Коммит 3a314584f8
1 изменённых файлов: 10 добавлений и 1 удалений

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

@ -572,7 +572,16 @@ namespace IKVM.Internal
TypeWrapper wrapper = GetLoader(type.Assembly).CreateWrapperForAssemblyType(type);
if (wrapper != null)
{
wrapper = RegisterInitiatingLoader(wrapper);
if (type.IsGenericType && !type.IsGenericTypeDefinition)
{
// in the case of "magic" implementation generic type instances we'll end up here as well,
// but then wrapper.GetClassLoader() will return this anyway
wrapper = wrapper.GetClassLoader().RegisterInitiatingLoader(wrapper);
}
else
{
wrapper = RegisterInitiatingLoader(wrapper);
}
if (wrapper.TypeAsTBD != type && (!wrapper.IsRemapped || wrapper.TypeAsBaseType != type))
{
// this really shouldn't happen, it means that we have two different types in our assembly that both