if i’m using a k/n dynamic library from C, is ther...
# kotlin-native
m
if i’m using a k/n dynamic library from C, is there a way to go from an
Any
struct to a primitive type? For example, if I know a particular instance of
Any
contains an int, how can i get it out of the
Any
struct? I tried
int l = *(int *) kotlin_any.pinned;
, which doesn’t appear to work
o
Just write a method in Kotlin doing conversion and call it
m
yeah, i know i could do that. but i’m trying to write a single boilerplate method to get items of many types from kotlin lists. as it stands, i have to write
getIntFromList
,
getFloatFromList
,
getStringFromList
, etc
o
Or have
getElement
returning
Any
and create convertors
anyToXXX