• Pickle

    Pickle

    3 years ago
    Pickle
    1 replies
    Copy to Clipboard
  • SrSouza

    SrSouza

    3 years ago
    Hi guys, my setter is not working with private set properties Without the private in the object, works fine
    val setter = prop.setter.apply { isAccessible = true } // line 52
    setter.call( // line 53
      instance,
      adapter(
        instance,
        prop,
        if (any is Number) fixNumberType(prop, any) else any
      )
    SrSouza
    1 replies
    Copy to Clipboard
  • dmcg

    dmcg

    3 years ago
    Is there anything in the stdlib that captures the class and nullability of a type?
    dmcg
    d
    4 replies
    Copy to Clipboard
  • DALDEI

    DALDEI

    3 years ago
    Given an object instance and class is there a way to bind the class member properties to the instance to produce a bound property reference ? E.g. convert a KProperty1 to a KProperty0 Say``` fun bind( obj: Any ) : List<KProperty0<*>> { val props1= obj::class.memberProperties // KProperty1<T,R> return props.map { bind( it , obj ) ???? } // KProperty0<R> } I can do this: fun bin( knownObject: MyClass ) = listOf( knownObject:😛rop1 , knownObject:😛rop2 , ...) But cant find a way to do so generically (without enumerating each property by name/accessor )
    DALDEI
    2 replies
    Copy to Clipboard
  • Dariusz Kuc

    Dariusz Kuc

    3 years ago
    hello, does anyone know whether this change was intentional? Java 8 + Kotlin 1.3.31 ->
    println({}::class.simpleName)
    ->
    null
    Java 8 + Kotlin 1.3.40+ -> automatically generates numeric names
    "1"
    (and increments it for subsequent anonymous classes) Java 11 ->
    null
    Dariusz Kuc
    2 replies
    Copy to Clipboard
  • p

    pniederw

    3 years ago
    Does kotlin-reflect-1.3.x have known JDK 11 incompatibilities? Our static analyzer claims it's using JDK APIs that aren't available in 11 (unfortunately I don't have details).
    p
    1 replies
    Copy to Clipboard
  • nils

    nils

    2 years ago
    Hello, I'm currently working on a framework, which uses reflection to parse and introspect functions. I'm aware that Kotlin applies type erasure to generics during runtime (effectively turning
    SomeClass<Type>
    into
    SomeClass<*>
    ). However, I'd expect type checks such as the one outlined below to correctly yield
    true
    . I'd like to ask if the below code snippet is a mistake on my end or if it's related to some kind of bug related to invariances. Thank you.
    nils
    Shane Myrick
    2 replies
    Copy to Clipboard
  • i

    ildar.i [Android]

    2 years ago
    Hi! Had to move method from class to extention and now it throws
    java.lang.IllegalAccessException: Class clean.db.entities.LocalizationDbEntityKt can not access a member of class infin.api.core.legal.entities.auth.login.LocalizationFromServer with modifiers "private final"
    fun LocalizationFromServer.toList() = LocalizationFromServer::class.java.declaredFields.map {
        LocalizationDbEntity(it.name, it.get(this)?.toString())
    }
    Cah anyone help pls?
    i
    r
    2 replies
    Copy to Clipboard
  • i

    int02h

    2 years ago
    Hi! Did I understand it right that kotlin-reflect extracts information about class (for example member names) from its
    @Metadata
    annotation? Because I can extract class member original names even if ProGuard/R8 has obfusacted the class. Does it make reverse engineering easier because bytecode of the class contains information about its members in
    @Metadata
    annotation?
    i
    d
    +1
    21 replies
    Copy to Clipboard
  • Eugen Martynov

    Eugen Martynov

    2 years ago
    Probably already asked many times, how can I workaround issue
    java.lang.AssertionError: Built-in class kotlin.Any is not found
    Or it is fixed already?
    Eugen Martynov
    udalov
    2 replies
    Copy to Clipboard