FOR_LOOP_ITERATOR
- temporary variable for for-loop iterator
FOR_LOOP_VARIABLE
- `x` in `for (x in xs)`
FOR_LOOP_IMPLICIT_VARIABLE
- temporary variable for for-loop with destructuring, e.g.:
for ((x, y) in xys)
=>
for (tmp in xys) {
val (x, y) = tmp
}
Argument matching status can be considered an "error" in resolve,
even though it is not a compilation error and doesn't prevent code
from being generated.
Actually, we should only check if the argument matching status is
ArgumentMatch.
#KT-18294 Fixed
This causes a subtle issue with 'copy' function for data class,
which has parameters with source elements corresponding to
the data class primary constructor parameters: default value expression
for such parameters is generated second time (to be overwritten later),
which creates duplicate bindings if such expression included any
(possibly anonymous) declarations, such as lambdas or anonymous objects.
#KT-18208 Fixed
1. Determine source element for descriptors with NO_SOURCE recursively.
2. Always provide type abbreviation for type alias constructor
return type.
#KT-15495 Fixed
In the following code example
fun test(f: Any.() -> Unit) = 42.f()
front-end resolves variable-as-function call for 'f' as 'invoke'
with signature 'Function1<Any, Unit>#Any.() -> Unit'.
However, Function1<Any, Unit> has a single 'invoke' method
with signature 'Function1<Any, Unit>#(Any) -> Unit'.
This didn't cause any problems with loosely typed JVM and JS back-ends.
However, in IR with symbols this means a reference to non-existing
declaration.
Local delegated property accessors calling suspend operators getValue
or setValue should be suspend functions themselves.
KT-17605 Getter and setter of suspend delegated property are not suspend
Consider this code:
object Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): String {
return ""
}
}
class A {
val String.ext by Delegate
}
then the type of <p> is KProperty2 (it has 2 receivers).
Test fix + review fixes
Generate 'do-while' loop body as IrComposite, because variables declared
in loop body should be visible in loop condition.
Wrap 'do-while' loop in IrBlock so that variables declared in loop body
are not visible outside of the loop.
Generate 'while' and 'do-while' loops as expressions of type Unit.