``` private fun getStringProp(prop: String): Strin...
# android
f
Copy code
private fun getStringProp(prop: String): String? {
            return try {
                propGetMethodHandle.invokeExact(prop, null as String?) as String?
            } catch (e: Exception) {
                Log.e(TAG, "Error invoking SystemProperties", e)
                return null
            }
        }

compiles to 
    INVOKEVIRTUAL java/lang/invoke/MethodHandle.invokeExact ([Ljava/lang/Object;)Ljava/lang/Object;

Any idea why this may be? I thought PolymorphicSignature methods are supported
e
using Kotlin 1.8.21,
javap -v
reports
Copy code
16: invokevirtual #26                 // Method java/lang/invoke/MethodHandle.invokeExact:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
on that example for me
f
weird. Android plugin doing something weird?
Did you try this on an Android build?
e
no, I tested on the command line
f
The issue I’m having is when compiling against Android SDK
I am checking the classes generated in intermediates/kotlin/… Those are supposedly before any transforms, right?
That’s ./build/tmp/kotlin-classes/
e
well, it is indeed miscompiled if I use
kotlinc -no-jdk -cp .../android.jar
, so it does seem to be an issue with the Android SDK or in how Kotlin handles using it instead of JAVA_HOME
f
Could you provide me with the version of the android.jar you used so I can open a ticket with JB?
e
$ANDROID_HOME/platforms/android-34/android.jar but it doesn't matter which
Could you please help provide the env you used on this ticket? Apparently they cannot repro https://youtrack.jetbrains.com/issue/KT-60591/Polymorphic-signature-methods-are-miscompiled-on-Android