domfox
01/18/2019, 2:55 PMval Class<*>.desc: String
get() {
if (this == Void.TYPE) return "V"
// This is a clever exploitation of a format returned by Class.getName(): for arrays, it's almost an internal name,
// but with '.' instead of '/'
return createArrayType().name.substring(1).replace('.', '/')
}
fun Class<*>.createArrayType(): Class<*> =
Array.newInstance(this, 0)::class.java