Bug fix. When resolving properties corresponding to fields with type 2 access stubs, unloadable types with the same name should compare as equal.

This commit is contained in:
jfrijters 2012-06-11 15:41:37 +00:00
Родитель cbf90740d0
Коммит 94be3503c6
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -4244,7 +4244,7 @@ namespace IKVM.Internal
{
if(properties[i] != null
&& name == properties[i].Name
&& tw == GetPropertyTypeWrapper(properties[i]))
&& MatchTypes(tw, GetPropertyTypeWrapper(properties[i])))
{
fields.Add(new CompiledAccessStubFieldWrapper(this, properties[i], field, tw));
properties[i] = null;
@ -4275,6 +4275,11 @@ namespace IKVM.Internal
SetFields(fields.ToArray());
}
private static bool MatchTypes(TypeWrapper tw1, TypeWrapper tw2)
{
return tw1 == tw2 || (tw1.IsUnloadable && tw2.IsUnloadable && tw1.Name == tw2.Name);
}
private void AddPropertyFieldWrapper(List<FieldWrapper> fields, PropertyInfo property, FieldInfo field)
{
// NOTE explictly defined properties (in map.xml) are decorated with HideFromJava,