A question about nomenclature. Is is fair to say t...
# announcements
m
A question about nomenclature. Is is fair to say that generic functions are made by type parameter before those functions. The objection is that methods in generic classes are also generic functions so they can also be made by type parameter before hosting class. Is it so? Would you call such methods generic functions or rather methods in generic classes?
k
I would not call functions that don't introduce extra generic types "generic", but it's kind of fuzzy.
w
Not directly Kotlin, but Java’s specification says that
A method is generic if it declares one or more type variables.
(https://docs.oracle.com/javase/specs/jls/se13/html/jls-8.html#jls-8.4.4). Nothing is said about enclosing class or interface, so I’d go for the option that generic function are the ones that have an explicit type parameter.
👍 1
m
Thanks, great 🙂