# Free the memory pointed by this pointer
fun free `{ free(self); `}
+
+ # Use the address value
+ redef fun hash `{ return (long)self; `}
+
+ # Is equal to any instance pointing to the same address
+ redef fun ==(o) do return o isa Pointer and native_equals(o)
+ private fun native_equals(o: Pointer): Bool `{ return self == o; `}
end
# Task with a `main` method to be implemented by subclasses
../lib/core/kernel.nit:601,1--705,3: Error: `kernel$Byte` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
../lib/core/kernel.nit:707,1--885,3: Error: `kernel$Int` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
../lib/core/kernel.nit:887,1--1055,3: Error: `kernel$Char` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:1057,1--1064,3: Error: `kernel$Pointer` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:1066,1--1075,3: Error: `kernel$Task` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:1057,1--1071,3: Error: `kernel$Pointer` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:1073,1--1082,3: Error: `kernel$Task` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
Discrete -> Char [dir=back arrowtail=open style=dashed];
Pointer [
- label = "{Pointer||+ address_is_null(): Bool\l+ free()\l}"
+ label = "{Pointer||+ address_is_null(): Bool\l+ free()\l- native_equals(o: Pointer): Bool\l}"
]
Object -> Pointer [dir=back arrowtail=open style=dashed];