private void checkExpressionOfType(@NotNull XPathExpression expression, XPathType type, boolean explicit) {
            final XPathType exprType = expression.getType();
            if (exprType.isAbstract() || type.isAbstract()) return;

            if (exprType != type && (explicit || isCheckedConversion(exprType, type))) {
                if (explicit && exprType == XPathType.STRING && type == XPathType.BOOLEAN) {
                    final XPathExpression expr = ExpectedTypeUtil.unparenthesize(expression);
                    if (expr instanceof XPathFunctionCall && IGNORE_NODESET_TO_BOOLEAN_VIA_STRING &&
                            ((XPathFunctionCall)expr).getArgumentList()[0].getType() == XPathType.NODESET)
                    {
                        return;
                    }
                }

                final LocalQuickFix[] fixes;
                if (type != XPathType.NODESET) {
                    final XPathQuickFixFactory fixFactory = ContextProvider.getContextProvider(expression).getQuickFixFactory();
                    explicit = explicit && !(exprType == XPathType.STRING && type == XPathType.BOOLEAN);
                    fixes = fixFactory.createImplicitTypeConversionFixes(expression, type, explicit);
                } else {
                    fixes = null;
                }

                addProblem(
                  myManager.createProblemDescriptor(expression,
                                                    XPathBundle.message("inspection.message.expression.should.be.type", type.getName()),
                                                    myOnTheFly, fixes, ProblemHighlightType.GENERIC_ERROR_OR_WARNING));
            }
        }
private void checkExpressionOfType(@NotNull XPathExpression expression, XPathType type, boolean explicit)