Sometimes, state-machine, generated in inline functions with
crossinline parameter, is transformed, since all usages should be
renamed.
However, this is wrong: in this case, we will have state-machine
inside state-machine.
This fix addresses the issue.
#KT-25893 Fixed
Before this commit, function with same name but different signature
wasn't counted as name conflict, now it is - just because that exact
check in this place could be too complex and error-prone
Enhancement for KT-27539
Since at least in gradle-imported projects, the template could be found
in several modules, some of them - incomplete (parent/buildscript module)
the previous logic of filtering for already processed templates and roots
is incorrect, and therefore removed.
Also fixes the exception in our project "cannot load script definition"
Fix 'java.lang.AssertionError: PSI/document/model changes are not allowed during highlighting'
For script when there are some new dependencies we are restarting highlighting (see ScriptDependenciesCache)
In non-gradle project kotlin-stdlib-sources.jar contains sources for common and jvm part, so both (expect and actual) declarations are present in the same library sources scope.
We are moving expect declarations in the bottom of this list to avoid navigation on expect declaration when actual declaration is present in the same scope
^KT-28398 Fixed
In the desugaring for compound assignment to a collection element,
argument expression 'i' is mapped to value parameters 'iG' and 'iS' of
corresponding 'get' and 'set' operators.
In general, these value parameters can have different indices.
This requires extra machinery in argument generation - that is, to be
able to generate a particular expression argument using an arbitrary
callback. In the vast majority of the cases this callback will just use
the corresponding StatementGenerator to generate IR subtree for the
provided expression. In case of 'get' and 'set' operator calls for an
augmented assignment expression this will map corresponding argument
expressions to pregenerated temporary variables.
Thus, in the following context:
```
class A
operator fun A.get(vararg xs: Int) = 0
operator fun A.set(i: Int, j: Int, v: Int) {}
```
statement `a[1, 2] += 3` will be desugared as (in a really pseudo
Kotlin):
```
{
val tmp_array = a
val tmp_index0 = 1
val tmp_index1 = 2
tmp_array.set(
i = tmp_index0,
j = tmp_index1,
v = tmp_array.get(xs = [tmp_index0, tmp_index1]).plus(3)
)
}
```
Update jcabi-aether dependency from 0.10.1 to 1.0-SNAPSHOT. In order to
do that, add https://oss.sonatype.org/content/repositories/snapshots to
the repositories in tools/kotlin-script-util/build.gradle.kts
Script dependencies are resolved using jcabi-aether. Unfortunately "stable"
release (0.10.1) does not support proxies. Therefore, script dependencies
are not pulled behind a proxy. Issue is fixed in SNAPSHOT release of
jcabi-aether.
FIXED: KT-22363