Skip to content

Instantly share code, notes, and snippets.

@magdamiu
Created December 17, 2021 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magdamiu/dd1fa65671cee4faff2c446877dfe78f to your computer and use it in GitHub Desktop.
Save magdamiu/dd1fa65671cee4faff2c446877dfe78f to your computer and use it in GitHub Desktop.
inline and reified types | High performance with idiomatic Kotlin
inline fun <reified T> printTypeName() {
println(T::class.simpleName)
}
fun main() {
printTypeName<String>()
println(String::class.simpleName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment