private static boolean checkPrivateObjectsEquivalency(BStructureType lhsType, BStructureType rhsType,
List<TypePair> unresolvedTypes) {
Map<String, BField> rhsFields = rhsType.getFields();
for (Map.Entry<String, BField> lhsFieldEntry : lhsType.getFields().entrySet()) {
BField rhsField = rhsFields.get(lhsFieldEntry.getKey());
if (rhsField == null || !isSameType(rhsField.fieldType, lhsFieldEntry.getValue().fieldType)) {
return false;
}
}
BAttachedFunction[] lhsFuncs = lhsType.getAttachedFunctions();
BAttachedFunction[] rhsFuncs = rhsType.getAttachedFunctions();
for (BAttachedFunction lhsFunc : lhsFuncs) {
if (lhsFunc == lhsType.initializer || lhsFunc == lhsType.defaultsValuesInitFunc) {
continue;
}
BAttachedFunction rhsFunc = getMatchingInvokableType(rhsFuncs, lhsFunc, unresolvedTypes);
if (rhsFunc == null) {
return false;
}
}
return true;
}