Skip to content

[Bug] Firestore: credentials_provider_desktop.h shadows members of superclass #729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dconeybe opened this issue Nov 3, 2021 · 0 comments · Fixed by #731
Closed

[Bug] Firestore: credentials_provider_desktop.h shadows members of superclass #729

dconeybe opened this issue Nov 3, 2021 · 0 comments · Fixed by #731

Comments

@dconeybe
Copy link
Contributor

dconeybe commented Nov 3, 2021

When importing the C++ SDK into google3, the following warning surfaced, which looks legitimate:

non-static data member 'change_listener_' of 'FirebaseCppCredentialsProvider' shadows member inherited from type 'CredentialsProvider<firebase::firestore::credentials::AuthToken, firebase::firestore::credentials::User>'

third_party/firebase/ios/Releases/FirebaseFirestore/core/src/credentials/credentials_provider.h:82:39: declared here

The superclass, CredentialsProvider<AuthToken, User>, defines the following two protected data members:

CredentialChangeListener<ValueType> change_listener_;
bool force_refresh_ = false;

https://github.com/firebase/firebase-ios-sdk/blob/04b7555228b537a6cbebbc432f1f45d28336ba3d/Firestore/core/src/credentials/credentials_provider.h#L82-L84

The subclass, FirebaseCppCredentialsProvider, defines the following two private data members:

bool force_refresh_token_ = false;
firestore::credentials::CredentialChangeListener<firestore::credentials::User> change_listener_;

bool force_refresh_token_ = false;
// Provided by the user code; may be an empty function.
firestore::credentials::CredentialChangeListener<firestore::credentials::User>
change_listener_;

It appears that these data members in the subclass can simply be removed in favor of the ones defined in the superclass. It just so happens that one of their names collides. We should audit the other subclasses of CredentialsProvider to see if they also could benefit from this deduplication of member variables.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants