Betül Necanlı
Apr 20, 2023

--

Hi! Thank you for your comment :)

Since T is a generic type, the actual class of the argument is not known "until runtime". Therefore, the function can only print the Kotlin reflection object KClass<T>, which represents the class of type T at runtime. I should mention "runtime" instead of "compile time" to reflect this fact.

I'll fix the article to make it more clear to understand and thank you for let me know about this question!

--

--

Betül Necanlı
Betül Necanlı

Written by Betül Necanlı

Kotlin, Android Programming, Data Structures&Algorithms, Math. https://www.youtube.com/@betulnecanli

Responses (2)