Created
December 17, 2021 11:34
-
-
Save magdamiu/dd1fa65671cee4faff2c446877dfe78f to your computer and use it in GitHub Desktop.
inline and reified types | High performance with idiomatic Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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