Andrew Adams
01/15/2021, 12:01 AMinline fun <reified T : Any> T.Companion.extensionMethod = ...
Zach Klippenstein (he/him) [MOD]
01/15/2021, 12:44 AMZach Klippenstein (he/him) [MOD]
01/15/2021, 12:44 AMAndrew Adams
01/15/2021, 12:45 AMTobias Berger
01/15/2021, 3:08 PMstatic
in Java. If you have a static method/companion object function that exists in every class, why not just leave out the class and make it a global function? If you need the reified type, you can just provide it in the call like this
inline fun <reified T : Any> logger() = LoggerFactory.getLogger(T::class.java)
Andrew Adams
01/16/2021, 9:33 AM