diff --git a/lib/src/user.dart b/lib/src/user.dart
index 5842cfe78..bb6872803 100644
--- a/lib/src/user.dart
+++ b/lib/src/user.dart
@@ -185,7 +185,7 @@ class User extends Event {
       room.canChangePowerLevel && powerLevel < room.ownPowerLevel;
 
   @override
-  bool operator ==(dynamic other) => (other is User &&
+  bool operator ==(Object other) => (other is User &&
       other.id == id &&
       other.room == room &&
       other.membership == membership);