When a property backed by a final field is the delegate for interface
implementation by delegation, the backend should reuse the backing
field rather than introduce a new, extraneous `$$delegate_n` field.
This change adds D8 in addition to Dx which is being deprecated.
At some point after the official Dx deprecation, we should remove
the Dx checker.
Moving to D8 has the additional benefit that D8 can dex code
using java 8 features without using a separate desugaring tool.
This fixes an issue with lateinit properties where the metadata from
the original field was not copied to the nullable field in
LateinitLowering. Also consolidated related tests.
Before this commit, FIR2IR expected that FIR will have no receiver
in this case. However, now FIR *has* receiver, so we have to convert
it to object correctly
The issue was, that built IR function does not have a PSI element,
which is required to report error on suspend functions inside monitors.
In this case, use PSI element of the class, containing the function,
which is consistent with old BE.
It is easier to introduce a new lowering so the codegen will emit code for the old
tail-call optimizer to understand. Also, this is more flexible and would allow to
optimize cases, which are now feasible with the old optimizer.
Note, that because of bytecode inlining, we cannot replace the old one, but we cannot
emit code, that is simpler for it to optimize.
Since the markers replace ALOAD 0 as continuations, passed to suspend calls, in
JVM_IR we do not need this, since in JVM_IR all inline lambdas are static
functions.
When called by reflection the bit mask will be generated
discounting dispatch/extension receivers. Make sure that the
interpretation of the bit mask is consistent for direct and
reflective calls.
In addition, this also fixes the modifiers on java 8 parameter
metadata for the dispatch and extension receivers for these
inline class methods.
An uninferred parameter stub may leak through calculation of CST(Inv<Uninferred Stub>, Nothing) into a result type.
A stub type in the result type means a type error. So we can afford recalculating
CST with stub-containing types filtered out, since its an error anyway.
This prevents stub types leakages and helps with reporting type error diagnostics.
KT-35914 Fixed
KT-35943 Fixed