From: Jean Privat Date: Wed, 27 May 2015 23:22:17 +0000 (-0400) Subject: model: introduce `MMethod::is_null_safe` X-Git-Tag: v0.7.5~4^2~4 X-Git-Url: http://nitlanguage.org model: introduce `MMethod::is_null_safe` Signed-off-by: Jean Privat --- diff --git a/src/model/model.nit b/src/model/model.nit index 94f11f2..e4b881f 100644 --- a/src/model/model.nit +++ b/src/model/model.nit @@ -2153,6 +2153,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