void InitBaseTypes(IKVM.Reflection.Type typeDefinition, ICollection<ITypeReference> baseTypes) { // set base classes if (typeDefinition.IsEnum) { foreach (var enumField in typeDefinition.GetFields (bindingFlags)) { if (!enumField.IsStatic) { baseTypes.Add(ReadTypeReference(enumField.FieldType)); break; } } } else { if (typeDefinition.BaseType != null) { baseTypes.Add(ReadTypeReference(typeDefinition.BaseType)); } foreach (var iface in typeDefinition.GetInterfaces ()) { baseTypes.Add(ReadTypeReference(iface)); } } }