Skip to content

Commit 88bb9dc

Browse files
authored
fix(*): operator == takes Object parameter (#5443)
Close #5288
1 parent 26f2323 commit 88bb9dc

File tree

20 files changed

+20
-32
lines changed

20 files changed

+20
-32
lines changed

packages/cloud_firestore/cloud_firestore/lib/src/collection_reference.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CollectionReference extends Query {
6565
}
6666

6767
@override
68-
bool operator ==(dynamic other) =>
68+
bool operator ==(Object other) =>
6969
other is CollectionReference &&
7070
other.firestore == firestore &&
7171
other.path == path;

packages/cloud_firestore/cloud_firestore/lib/src/document_reference.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class DocumentReference {
8888

8989
@override
9090
// ignore: avoid_equals_and_hash_code_on_mutable_classes
91-
bool operator ==(dynamic other) =>
91+
bool operator ==(Object other) =>
9292
other is DocumentReference &&
9393
other.firestore == firestore &&
9494
other.path == path;

packages/cloud_firestore/cloud_firestore/lib/src/firestore.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class FirebaseFirestore extends FirebasePluginPlatform {
207207

208208
@override
209209
// ignore: avoid_equals_and_hash_code_on_mutable_classes
210-
bool operator ==(dynamic other) =>
210+
bool operator ==(Object other) =>
211211
other is FirebaseFirestore && other.app.name == app.name;
212212

213213
@override

packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/blob.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Blob {
1919
final Uint8List bytes;
2020

2121
@override
22-
bool operator ==(dynamic other) =>
22+
bool operator ==(Object other) =>
2323
other is Blob &&
2424
const DeepCollectionEquality().equals(other.bytes, bytes);
2525

packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/field_path.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class FieldPath {
5050
assert(!path.contains(']'), _reserved);
5151

5252
@override
53-
bool operator ==(dynamic other) =>
53+
bool operator ==(Object other) =>
5454
other is FieldPath &&
5555
const ListEquality().equals(other.components, components);
5656

packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/geo_point.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class GeoPoint {
1818
final double longitude; // ignore: public_member_api_docs
1919

2020
@override
21-
bool operator ==(dynamic other) =>
21+
bool operator ==(Object other) =>
2222
other is GeoPoint &&
2323
other.latitude == latitude &&
2424
other.longitude == longitude;

packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/internal/pointer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Pointer {
7373
}
7474

7575
@override
76-
bool operator ==(dynamic other) => other is Pointer && other.path == path;
76+
bool operator ==(Object other) => other is Pointer && other.path == path;
7777

7878
@override
7979
int get hashCode => path.hashCode;

packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_field_value.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MethodChannelFieldValue {
4444
final dynamic value;
4545

4646
@override
47-
bool operator ==(dynamic other) =>
47+
bool operator ==(Object other) =>
4848
other is MethodChannelFieldValue &&
4949
other.type == type &&
5050
const DeepCollectionEquality().equals(other.value, value);

packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/settings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Settings {
5353
}
5454

5555
@override
56-
bool operator ==(dynamic other) =>
56+
bool operator ==(Object other) =>
5757
other is Settings && other.asMap.toString() == asMap.toString();
5858

5959
@override

packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/timestamp.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Timestamp implements Comparable<Timestamp> {
8787
int get hashCode => hashValues(seconds, nanoseconds);
8888

8989
@override
90-
bool operator ==(dynamic other) =>
90+
bool operator ==(Object other) =>
9191
other is Timestamp &&
9292
other.seconds == seconds &&
9393
other.nanoseconds == nanoseconds;

packages/cloud_firestore/cloud_firestore_web/lib/src/field_value_web.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FieldValueWeb {
1717

1818
@override
1919
//ignore: avoid_equals_and_hash_code_on_mutable_classes
20-
bool operator ==(dynamic other) =>
20+
bool operator ==(Object other) =>
2121
other is FieldValueWeb && other.data == data;
2222

2323
@override

packages/firebase_core/firebase_core/lib/src/firebase.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Firebase {
5959
// TODO(rrousselGit): remove ==/hashCode
6060
@override
6161
// ignore: avoid_equals_and_hash_code_on_mutable_classes
62-
bool operator ==(dynamic other) {
62+
bool operator ==(Object other) {
6363
if (identical(this, other)) return true;
6464
if (other is! Firebase) return false;
6565
return other.hashCode == hashCode;

packages/firebase_core/firebase_core/lib/src/firebase_app.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class FirebaseApp {
5656

5757
@override
5858
// ignore: avoid_equals_and_hash_code_on_mutable_classes
59-
bool operator ==(dynamic other) {
59+
bool operator ==(Object other) {
6060
if (identical(this, other)) return true;
6161
if (other is! FirebaseApp) return false;
6262
return other.name == name && other.options == options;

packages/firebase_core/firebase_core/test/firebase_core_test.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,4 @@ class MockFirebaseCore extends Mock
111111
}
112112

113113
// ignore: avoid_implementing_value_types
114-
class FakeFirebaseAppPlatform extends Fake implements FirebaseAppPlatform {
115-
@override
116-
// ignore: avoid_equals_and_hash_code_on_mutable_classes, hash_and_equals
117-
bool operator ==(Object? other) {
118-
return super == other;
119-
}
120-
}
114+
class FakeFirebaseAppPlatform extends Fake implements FirebaseAppPlatform {}

packages/firebase_core/firebase_core_platform_interface/lib/src/firebase_exception.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class FirebaseException implements Exception {
5454
final StackTrace? stackTrace;
5555

5656
@override
57-
bool operator ==(dynamic other) {
57+
bool operator ==(Object other) {
5858
if (identical(this, other)) return true;
5959
if (other is! FirebaseException) return false;
6060
return other.hashCode == hashCode;

packages/firebase_core/firebase_core_platform_interface/lib/src/firebase_options.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class FirebaseOptions {
165165

166166
// Required from `fromMap` comparison
167167
@override
168-
bool operator ==(dynamic other) {
168+
bool operator ==(Object other) {
169169
if (identical(this, other)) return true;
170170
if (other is! FirebaseOptions) return false;
171171
return other.asMap.toString() == asMap.toString();

packages/firebase_core/firebase_core_platform_interface/lib/src/platform_interface/platform_interface_firebase_app.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class FirebaseAppPlatform extends PlatformInterface {
6060

6161
@override
6262
// ignore: avoid_equals_and_hash_code_on_mutable_classes
63-
bool operator ==(Object? other) {
63+
bool operator ==(Object other) {
6464
if (identical(this, other)) return true;
6565
if (other is! FirebaseAppPlatform) return false;
6666
return other.name == name && other.options == options;

packages/firebase_core/firebase_core_platform_interface/test/platform_interface_tests/platform_interface_firebase_core_test.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,7 @@ class ImplementsFirebasePlatform implements FirebasePlatform {
5252
}
5353

5454
// ignore: avoid_implementing_value_types
55-
class FakeFirebaseAppPlatform extends Fake implements FirebaseAppPlatform {
56-
@override
57-
// ignore: avoid_equals_and_hash_code_on_mutable_classes, hash_and_equals, false positive
58-
bool operator ==(Object? other) {
59-
return super == other;
60-
}
61-
}
55+
class FakeFirebaseAppPlatform extends Fake implements FirebaseAppPlatform {}
6256

6357
class ExtendsFirebasePlatform extends FirebasePlatform {}
6458

packages/firebase_storage/firebase_storage/lib/src/firebase_storage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class FirebaseStorage extends FirebasePluginPlatform {
150150
}
151151

152152
@override
153-
bool operator ==(Object? other) =>
153+
bool operator ==(Object other) =>
154154
other is FirebaseStorage &&
155155
other.app.name == app.name &&
156156
other.bucket == bucket;

packages/firebase_storage/firebase_storage/lib/src/reference.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class Reference {
195195
}
196196

197197
@override
198-
bool operator ==(Object? other) =>
198+
bool operator ==(Object other) =>
199199
other is Reference &&
200200
other.fullPath == fullPath &&
201201
other.storage == storage;

0 commit comments

Comments
 (0)