deriving :: Derivable :: derive_to_map
self
.Warning: by default the method returns an empty Map.
It is done this way so that subclasses can just call super
and add their own attributes.
Forgetting to redefine derive_to_map
will broke the expectation of the user of the class
Since an empty map is not POLA.
Note that the semantic of keys and values is let unspecified. Moreover, there is no specification nor mechanism to avoid key collision.
# Returns a map that loosely represents the object `self`.
#
# Warning: by default the method returns an empty Map.
# It is done this way so that subclasses can just call `super` and add their own attributes.
#
# Forgetting to redefine `derive_to_map` will broke the expectation of the user of the class
# Since an empty map is not POLA.
#
# Note that the semantic of keys and values is let unspecified.
# Moreover, there is no specification nor mechanism to avoid key collision.
fun derive_to_map: Map[String, nullable Object]
do
return new HashMap[String, nullable Object]
end
lib/deriving/deriving.nit:47,2--60,4