burg
04/02/2018, 11:55 PMsandeep
04/03/2018, 6:03 AMAny
is inherited from Any?
(?) at least as per the diagram belowsandeep
04/03/2018, 6:03 AMhttp://natpryce.com/articles/000818/entire-hierarchy.png▾
sandeep
04/03/2018, 6:04 AMsandeep
04/03/2018, 6:06 AMtest2<String?>()
doesn’t work (as T is bounded by Any)sandeep
04/03/2018, 6:07 AMinline fun <reified T> test3(): KClass<T> = T::class // does not compile
doesn’t compile is since T is unbounded but the T of KClass is bounded by Any
sandeep
04/03/2018, 6:09 AMsandeep
04/03/2018, 6:11 AMburg
04/03/2018, 3:48 PMString?::class
actually return the same as String::class
(and it does, at some level, if you look at how test1 works in my example).burg
04/03/2018, 3:49 PMlouiscad
04/04/2018, 5:52 AM