nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: A collection of miscellaneous commits
[nit.git]
/
tests
/
base_eq.nit
diff --git
a/tests/base_eq.nit
b/tests/base_eq.nit
index
b2db161
..
13f0ec7
100644
(file)
--- a/
tests/base_eq.nit
+++ b/
tests/base_eq.nit
@@
-17,28
+17,28
@@
import kernel
class A
import kernel
class A
- readable attr _a: Int
-
+ var a: Int
+
init(a: Int)
do
init(a: Int)
do
- _a = a
+ a = a
end
end
class B
end
end
class B
-special A
- redef meth ==(a: Object): Bool
+ super A
+ redef fun ==(o: nullable Object): Bool
do
do
- if not a isa B then
+ if not o isa B then
return false
end
return false
end
- assert a isa B
- return a.a is _a
+
+ return o.a.is_same_instance(a)
end
end
- redef init(b: Int)
+ init(b: Int)
do
do
- _a = b
+ a = b
end
end
end
end
@@
-64,12
+64,12
@@
b1.is_same_type(b2).output
'\n'.output
'\n'.output
-(a1 is a1).output
-(a1 is a2).output
-(not a1 is a3).output
-(not a1 is b1).output
-(not b1 is b2).output
-(not b1 is b3).output
+(a1.is_same_instance(a1)).output
+(a1.is_same_instance(a2)).output
+(not a1.is_same_instance(a3)).output
+(not a1.is_same_instance(b1)).output
+(not b1.is_same_instance(b2)).output
+(not b1.is_same_instance(b3)).output
'\n'.output
'\n'.output