Merge: Warn call on nullable receiver
[nit.git] / src / model / model.nit
index 908cb60..4e9be82 100644 (file)
@@ -2156,6 +2156,10 @@ class MMethod
        do
                return self.is_init
        end
+
+       # A specific method that is safe to call on null.
+       # Currently, only `==`, `!=` and `is_same_instance` are safe
+       fun is_null_safe: Bool do return name == "==" or name == "!=" or name == "is_same_instance"
 end
 
 # A global attribute