mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-27 12:38:45 +00:00
update klassindex code
This commit is contained in:
parent
ccf89830bd
commit
bf9268a30f
@ -33,7 +33,8 @@ fun printlnInstancesSubclassesFuns(kclass: KClass<*>, subclasses: Set<KClass<*>>
|
||||
val imports = "import ${subclass.qualifiedName}" + if (typeUpperBounds.isEmpty()) "" else typeUpperBounds.joinToString("\nimport ", "\nimport ")
|
||||
val subtype = "${subclass.simpleName}${if (typeUpperBounds.isEmpty()) "" else "<${typeUpperBounds.joinToString() { (it.classifier as KClass<*>).simpleName!! }}>"}"
|
||||
val code = "@PreviewFeature\ninline fun ${kclass.simpleName}.as${subclass.simpleName}(): $subtype? = this as? $subtype\n" +
|
||||
"@PreviewFeature\ninline fun ${kclass.simpleName}.require${subclass.simpleName}(): $subtype = this as $subtype"
|
||||
"@PreviewFeature\ninline fun ${kclass.simpleName}.require${subclass.simpleName}(): $subtype = this as $subtype\n" +
|
||||
"@PreviewFeature\ninline fun <T> ${kclass.simpleName}.when${subclass.simpleName}(block: (${subclass.simpleName}) -> T): $subtype = as${subclass.simpleName}() ?.let(block)"
|
||||
imports to code
|
||||
}
|
||||
}
|
||||
@ -65,4 +66,4 @@ fun main() {
|
||||
// printlnInstanceSubclassesFuns(InputMedia::class)
|
||||
// printlnInstanceSubclassesFuns(Poll::class)
|
||||
// printlnInstanceSubclassesFuns(Update::class)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user