Code review comment: Probably don't need the `isLhsAService` here also?

Code under review:
public boolean checkObjectEquivalency(BObjectType rhsType, BObjectType lhsType, Set<TypePair> unresolvedTypes) {
        if (Symbols.isFlagOn(lhsType.flags, Flags.ISOLATED) && !Symbols.isFlagOn(rhsType.flags, Flags.ISOLATED)) {
            return false;
        }

        BObjectTypeSymbol lhsStructSymbol = (BObjectTypeSymbol) lhsType.tsymbol;
        BObjectTypeSymbol rhsStructSymbol = (BObjectTypeSymbol) rhsType.tsymbol;
        List<BAttachedFunction> lhsFuncs = lhsStructSymbol.attachedFuncs;
        List<BAttachedFunction> rhsFuncs = ((BObjectTypeSymbol) rhsType.tsymbol).attachedFuncs;
        int lhsAttachedFuncCount = getObjectFuncCount(lhsStructSymbol);
        int rhsAttachedFuncCount = getObjectFuncCount(rhsStructSymbol);

        
        boolean isLhsAService = Symbols.isService(lhsStructSymbol);
        if (isLhsAService && !Symbols.isService(rhsStructSymbol)) {
            return false;
        }

        
        if (lhsType.fields.size() > rhsType.fields.size() || lhsAttachedFuncCount > rhsAttachedFuncCount) {
            return false;
        }

        
        for (BField bField : lhsType.fields.values()) {
            if (Symbols.isPrivate(bField.symbol)) {
                return false;
            }
        }

        for (BAttachedFunction func : lhsFuncs) {
            if (Symbols.isPrivate(func.symbol)) {
                return false;
            }
        }

        for (BField lhsField : lhsType.fields.values()) {
            BField rhsField = rhsType.fields.get(lhsField.name.value);
            if (rhsField == null ||
                    !isInSameVisibilityRegion(lhsField.symbol, rhsField.symbol) ||
                    !isAssignable(rhsField.type, lhsField.type, unresolvedTypes)) {
                return false;
            }
        }

        for (BAttachedFunction lhsFunc : lhsFuncs) {
            if (lhsFunc == lhsStructSymbol.initializerFunc) {
                continue;
            }

            
            if (isLhsAService && Symbols.isResource(lhsFunc.symbol)) {
                continue;
            }

            BAttachedFunction rhsFunc = getMatchingInvokableType(rhsFuncs, lhsFunc, unresolvedTypes);
            if (rhsFunc == null || !isInSameVisibilityRegion(lhsFunc.symbol, rhsFunc.symbol)) {
                return false;
            }
            if (Symbols.isRemote(lhsFunc.symbol) != Symbols.isRemote(rhsFunc.symbol)) {
                return false;
            }
        }

        return lhsType.typeIdSet.isAssignableFrom(rhsType.typeIdSet);
    }

Line commented on: if (isLhsAService && Symbols.isResource(lhsFunc.symbol)) {

Revised code:
public boolean checkObjectEquivalency(BObjectType rhsType, BObjectType lhsType, Set<TypePair> unresolvedTypes) {
        if (Symbols.isFlagOn(lhsType.flags, Flags.ISOLATED) && !Symbols.isFlagOn(rhsType.flags, Flags.ISOLATED)) {
            return false;
        }

        BObjectTypeSymbol lhsStructSymbol = (BObjectTypeSymbol) lhsType.tsymbol;
        BObjectTypeSymbol rhsStructSymbol = (BObjectTypeSymbol) rhsType.tsymbol;
        List<BAttachedFunction> lhsFuncs = lhsStructSymbol.attachedFuncs;
        List<BAttachedFunction> rhsFuncs = ((BObjectTypeSymbol) rhsType.tsymbol).attachedFuncs;
        int lhsAttachedFuncCount = getObjectFuncCount(lhsStructSymbol);
        int rhsAttachedFuncCount = getObjectFuncCount(rhsStructSymbol);

        
        boolean isLhsAService = Symbols.isService(lhsStructSymbol);
        if (isLhsAService && !Symbols.isService(rhsStructSymbol)) {
            return false;
        }

        
        if (lhsType.fields.size() > rhsType.fields.size() || lhsAttachedFuncCount > rhsAttachedFuncCount) {
            return false;
        }

        
        for (BField bField : lhsType.fields.values()) {
            if (Symbols.isPrivate(bField.symbol)) {
                return false;
            }
        }

        for (BAttachedFunction func : lhsFuncs) {
            if (Symbols.isPrivate(func.symbol)) {
                return false;
            }
        }

        for (BField lhsField : lhsType.fields.values()) {
            BField rhsField = rhsType.fields.get(lhsField.name.value);
            if (rhsField == null ||
                    !isInSameVisibilityRegion(lhsField.symbol, rhsField.symbol) ||
                    !isAssignable(rhsField.type, lhsField.type, unresolvedTypes)) {
                return false;
            }
        }

        for (BAttachedFunction lhsFunc : lhsFuncs) {
            if (lhsFunc == lhsStructSymbol.initializerFunc) {
                continue;
            }

            
            if (isLhsAService && Symbols.isResource(lhsFunc.symbol)) {
                continue;
            }

            BAttachedFunction rhsFunc = getMatchingInvokableType(rhsFuncs, lhsFunc, unresolvedTypes);
            if (rhsFunc == null || !isInSameVisibilityRegion(lhsFunc.symbol, rhsFunc.symbol)) {
                return false;
            }
            if (Symbols.isRemote(lhsFunc.symbol) != Symbols.isRemote(rhsFunc.symbol)) {
                return false;
            }
        }

        return lhsType.typeIdSet.isAssignableFrom(rhsType.typeIdSet);
    }