As I know type Any in Kotlin is similar to Object in java which by default is implemented by any class we declare. I want to extend the class name into a new val classTag. Thus,
When I extend a function it works fine,
fun Any.getClassTag(): String { return this::class.java.simpleName }
But I found compilers error in case when I extend a val type.
val Any.classTag: String { return this::class.java.simpleName }
Function declaration must have a name
How to deal with that?