when i declare a propperty in a class like following:
class xx{
var a:()->Boolean={false}
}
and then decompiler as following:
…
public xxx() {
this.b = (Function0)null.INSTANCE;
}
…
what does the (Function0)null.INSTANCE stands for?
i think it will be :this.b= new Function0() {
public final Object invoke() {
return false;
}
};
but not ,why?
The Java decompiler is intended to decompile code produced by the Java compiler. In most cases, it can produce sensible results when decompiling Kotlin-generated bytecode, but that is not always the case. In this particular case, the decompiled code is incorrect and does not represent what is actually happening.
If you just want to know what is going on, the disassembler will be able to tell you (but less accessible than a decompiler). The Kotlin plugin will even display the generated bytecode for you.