Lucy
01/16/2023, 7:05 PMpublic final class Test public constructor() {
public final fun addOne(num: <http://kotlin.Int|kotlin.Int>): <http://kotlin.Int|kotlin.Int> { /* compiled code */ }
public final suspend fun suspendAddOne(num: <http://kotlin.Int|kotlin.Int>): <http://kotlin.Int|kotlin.Int> { /* compiled code */ }
}
Same code after using 1.8.0 and minify
public final class Test {
public static final int $stable;
public Test() {
}
public final Object suspendAddOne(int var1, Continuation<? super Integer> var2) {
return Boxing.boxInt(var1 + 1);
}
public final int addOne(int var1) {
return var1 + 2;
}
}
In 1.8.0, I am also getting an extra parameter variable with suspend functions. I can't find any documentation or logs about this change (looked at kotlin, gradle, and minify/R8 release pages). If anyone could point me in the right direction it would be greatly appreciated!ephemient
01/17/2023, 12:52 AMContinuation
parameter has always been there in all versions, that's how `suspend fun`s are implemented. how are you inspecting the class files?Lucy
01/17/2023, 7:48 AMcontinuation
parameter seen in the APK analyzer.Lucy
01/17/2023, 7:51 AMephemient
01/17/2023, 8:07 AMsuspend fun
or not. but that's purely for display, it's always there in the bytecode. you can use low-level tools like javap
or baksmali
to seeLucy
01/17/2023, 8:44 AM