bool IDLParserErrorContext::checkAndAssertTypeSlowPath(const BSONElement& element,
                                                       BSONType type) const {
    auto elementType = element.type();

    // If the type is wrong, ignore Null and Undefined values
    if (elementType == jstNULL || elementType == Undefined) {
        return false;
    }

    std::string path = getElementPath(element);
    uasserted(ErrorCodes::TypeMismatch,
              str::stream() << "BSON field '" << path << "' is the wrong type '"
                            << typeName(elementType)
                            << "', expected type '"
                            << typeName(type)
                            << "'");
}
bool IDLParserErrorContext::checkAndAssertTypeSlowPath(const BSONElement& element,
                                                       BSONType type) const {
    auto elementType = element.type();

     
    if (elementType == jstNULL || elementType == Undefined) {
        return false;
    }

    std::string path = getElementPath(element);
    uasserted(ErrorCodes::TypeMismatch,
              str::stream() << "BSON field '" << path << "' is the wrong type '"
                            << typeName(elementType)
                            << "', expected type '"
                            << typeName(type)
                            << "'");
}