The default bound for generic formal parameter is already 'Object'.
And soon the default bound will be 'nullable Object'.
Signed-off-by: Jean Privat <jean@pryen.org>
# Naive implementation of collections method
# You only have to define iterator!
-interface NaiveCollection[E: Object]
+interface NaiveCollection[E]
special Collection[E]
redef meth is_empty do return length == 0
end
# A HashCollection is an array of HashNode[K] indexed by the K hash value
-private class HashCollection[K: Object, N: HashNode[K], E: Object]
+private class HashCollection[K: Object, N: HashNode[K], E]
special Collection[E]
special ArrayCapable[N]
attr _array: NativeArray[N] = null # Used to store items
end
end
-redef class Array[F: Object]
+redef class Array[F]
redef meth add(item: F)
do
self[length] = item