https://kotlinlang.org logo
#announcements
Title
# announcements
v

ValV

06/30/2019, 7:47 PM
Are there some comfortable Kotlin (perhaps, online) decompilers? Java decompilers give something like
kotlin.jvm.functions.Function0
1
g

gildor

07/01/2019, 12:39 AM
There are no Kotlin specific decompilers, as I know
Also, what is wrong with Function0? This is how lambda with no params represented on JVM
🙏 1
g

GauthierPLM

07/01/2019, 2:38 AM
https://kotlinlang.org/docs/reference/whatsnew13.html#functions-with-big-arity Was reading that just now, give an explanation for these weird name
👍 1
g

gildor

07/01/2019, 3:12 AM
It’s not weird, Lambdas do not exist in bytecode, it’s a name of JVM interface that used to represent lambda
Also, it’s not only for big arity lambdas, Function0 is default interface for any lambda with 0 arguments
v

ValV

07/01/2019, 4:26 AM
Thanks for clarification. That was confusing part of the reversed code
'Cause I've tried JADX, CFR, Fernflower, JAD, JDCore, Procyon -- all of them give (lambdas) Function0/1
What are
functuinal types
-- are those lambdas only or + something else?
all of them give (lambdas) Function0/1
Of course, otherwise how it would represent in Java code?
v

ValV

07/01/2019, 5:09 AM
So all those types (
(A, B) -> C
,
A.(B) -> C
and
suspend () -> Unit
) are represented by Function0/1/.../42/... classes, right?
g

gildor

07/01/2019, 5:12 AM
Yes
Just try to access any Kotlin lambda from Java code, it will be the same
v

ValV

07/01/2019, 5:26 AM
Thanks, I'll try ☝️😃
2 Views