Skip to content

Commit 18dcf76

Browse files
authored
Fix warning about operator== param type. (#1300)
1 parent c03c1e9 commit 18dcf76

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
# 8.9.1
4+
5+
- Fix for new warning about `operator==` param type.
6+
37
# 8.9.0
48

59
- In `StandardJsonPlugin`, add support for specifying types that should be left

built_value/lib/json_object.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class BoolJsonObject extends JsonObject {
9797
bool get asBool => value;
9898

9999
@override
100-
bool operator ==(dynamic other) {
100+
bool operator ==(Object other) {
101101
if (identical(other, this)) return true;
102102
if (other is! BoolJsonObject) return false;
103103
return value == other.value;
@@ -123,7 +123,7 @@ class ListJsonObject extends JsonObject {
123123
List<Object?> get asList => value;
124124

125125
@override
126-
bool operator ==(dynamic other) {
126+
bool operator ==(Object other) {
127127
if (identical(other, this)) return true;
128128
if (other is! ListJsonObject) return false;
129129
return const DeepCollectionEquality().equals(value, other.value);
@@ -149,7 +149,7 @@ class MapJsonObject extends JsonObject {
149149
Map<String, Object?> get asMap => value;
150150

151151
@override
152-
bool operator ==(dynamic other) {
152+
bool operator ==(Object other) {
153153
if (identical(other, this)) return true;
154154
if (other is! MapJsonObject) return false;
155155
return const DeepCollectionEquality().equals(value, other.value);
@@ -173,7 +173,7 @@ class NumJsonObject extends JsonObject {
173173
num get asNum => value;
174174

175175
@override
176-
bool operator ==(dynamic other) {
176+
bool operator ==(Object other) {
177177
if (identical(other, this)) return true;
178178
if (other is! NumJsonObject) return false;
179179
return value == other.value;
@@ -197,7 +197,7 @@ class StringJsonObject extends JsonObject {
197197
String get asString => value;
198198

199199
@override
200-
bool operator ==(dynamic other) {
200+
bool operator ==(Object other) {
201201
if (identical(other, this)) return true;
202202
if (other is! StringJsonObject) return false;
203203
return value == other.value;

built_value/lib/serializer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class FullType {
269269
: FullType(root, parameters);
270270

271271
@override
272-
bool operator ==(dynamic other) {
272+
bool operator ==(Object other) {
273273
if (identical(other, this)) return true;
274274
if (other is! FullType) return false;
275275
if (root != other.root) return false;

0 commit comments

Comments
 (0)