Scope.createTemporaryVariableDeclaration has default values for
startOffset and endOffset parameters, which are UNDEFINED_OFFSET.
This is error-prone. Caller should typically be able to pass proper
offsets. If not, let using undefined offsets at least be explicit.
Remove default values for startOffset and endOffset parameters in
Scope.createTemporaryVariableDeclaration
The variable generated by IrStatementBuilder.irTemporary doesn't inherit
startOffset and endOffset from the builder. In particular, as a result,
temporary variables generated for elvis operator left operand have
UNDEFINED_OFFSET.
Additionally, ProvisionalFunctionExpressionLowering copies the offsets
of a variable to lowered lambda in the variable initializer. With the
problem described above, this causes invalid debug information in
Kotlin/Native, see KT-49360.
Fix irTemporary by using builder's offsets for the variable.
^KT-49360 Fixed
evaluator fragments
- Refactor JvmIrCodegenFactory to allow for caller's choice of
lowerings.
- Refactor of SyntheticAccessorLowering to expose the accessibility
check used to determine the need for accessors.
- Replacement of field, method and constructor uses with corresponding
java.lang.reflection API via additional lowering running _before_
the existing IR pipeline.
- Emulating super calls in the context of class methods via new
compiler intrinsic.
- psi2ir: Add support for `_field` suffix on properties in the
evaluator for accessing underlying fields when applicable.
- Add `JvmGeneratorExtensions` point for determining whether a
property accessor has a user-supplied body in order to predict how
they are ultimately compiled for the JVM.
Incorrect builder was used at line 269, which led to non-sensible type
in `IrClass.thisReceiver` for function types, such as
`SuspendFunction1<SuspendFunction1, SuspendFunction1>` in the linked
issue.
Avoid creating types manually completely to simplify this code and fix
the bug.
#KT-49168 Fixed
Putting them in the local variable table means that the debugger
needs to have special handling for parameters with specific names.
That forces us to generate mangled names for these.
Instead of also implementing the name mangling for FIR, this
change gets rid of the parameters from the LVT instead.
- Reuse JS IR Suspend function lowering
- Fix types
- Disable reinterpretCast-based optimization for inline
classes
- Add basic support to Wasm stdlib
- Explicitly transform suspend functions into regular functions
with continuations
- Clean suspend function handling from JS IR codegen