nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0767ae3
)
model: introduce `MMethod::is_null_safe`
author
Jean Privat
<jean@pryen.org>
Wed, 27 May 2015 23:22:17 +0000
(19:22 -0400)
committer
Jean Privat
<jean@pryen.org>
Wed, 27 May 2015 23:22:17 +0000
(19:22 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>
src/model/model.nit
patch
|
blob
|
history
diff --git
a/src/model/model.nit
b/src/model/model.nit
index
94f11f2
..
e4b881f
100644
(file)
--- 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