skip to Main Content

I installed Firebase with Auth, Firestore, Functions, per pod and I was filled with alerts that I was solving little by little, after that configure and test firebase functions and works fine. The only one I can’t solve is the following:

Implicit conversion loses integer precision: ‘typename std::enable_if<!std::is_same<void, decltype(block())>::value, decltype(block())>::type’ (aka ‘unsigned long’) to ‘int’

Here!

  int LocalStore::Backfill() const {
      return persistence_-> Run("Backfill Indexes", [&] {
        return index_backfiller_->WriteIndexEntries(this);
      });
    }

App and firebase DB seems to work fine but I don’t know what is that and what problem could I have it in the future!

enter image description here

Any help?

2

Answers


  1. Although I do not know the tool you are using, I can read the error message for you and this should help you to answer your question.

    So function int LocalStore::Backfill() const wants to return integer, a signed integer. But is fed with unsigned long by statement:

    persistence_-> Run("Backfill Indexes", [&] {
            return index_backfiller_->WriteIndexEntries(this);
          });
    

    which returns the type described as

    typename std::enable_if<!std::is_same<void, decltype(block())>::value, decltype(block())>::type
    

    which turns out to be a (aka 'unsigned long'), so unsigned long.

    So this is now your decision if such implicit casting is OK. I just want to say that this is a messy way of coding to confuse signed and unsigned and integer and long, even if it works.

    IMO you should change Backfill to return unsigned long.

    Login or Signup to reply.
  2. auto LocalStore::Backfill() const {
          return persistence_-> Run("Backfill Indexes", [&] {
            return index_backfiller_->WriteIndexEntries(this);
          });
        }
    

    return "auto"

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search