Ashu
10/26/2021, 7:58 AM{SomeObject} is {SomeClass}
as a parameter? I am trying to perform type checking inside a function where the type to check for meeds to be passed as an argument. Any way to achieve this?Ivan Pavlov
10/26/2021, 8:02 AMsomeClass.isInstance({SomeObject})
Ashu
10/26/2021, 8:11 AMis
keyword.ephemient
10/26/2021, 8:19 AMis
, it must be a reified type parameter to an inline functionephemient
10/26/2021, 8:20 AMephemient
10/26/2021, 8:22 AMfun f(t: KClass<T>)
and leave inline fun <reified T: Any> f() = f(T::class)
as a convenience wrapper onlyephemient
10/26/2021, 8:23 AMisInstance
is different syntax than is
, but inline
should be used judiciously to avoid excessive duplication of bytecodeAshu
10/26/2021, 8:26 AMAshu
10/26/2021, 8:27 AMephemient
10/26/2021, 8:33 AM