In init block or property initializers,
for `val x` declared in primary constructor,
`x` reference is now resolved to property, not to parameter.
So we need two different scopes for primary constructor,
one for 'pure' parameters and another one for all parameters,
including val/var ones.
#KT-42844 Fixed
AbstractKotlinTarget#buildAdhocComponentsFromKotlinVariants passes a
non-serializable local object to a lambda, which will fail during
serialization when configuration caching is enabled.
To fix that, this commit passes only the relevant parts of the object
to the lambda.
Bug: https://youtrack.jetbrains.com/issue/KT-43054
Test: Manually verified on
https://android.googlesource.com/platform/tools/metalava/+/refs/heads/master/
where the issue was detected (I haven't been able to create a mininal
reproducible project)
Updated KDoc generator template to address all instances of
a grammatical error ("less" -> "fewer").
Also committed newly generate _Collections.kt, _Sequences.kt,
and _Strings.kt.
Put their content to constructor-impl, so they are called during
constructor call, but they are not called during boxing, because
box-impl calls <init> and not constructor-impl.
#KT-28055 In progress
This allows the files to survive Gradle's `clean` task that deletes the
`build/` directory with all its contents, which leads to the IDE losing
dependencies until next re-import.
The `.gradle` directory is chosen because Gradle creates it in every
project and it is normally included in .gitignore (or otherwise ignored
in VCS).
Related to issue #KT-39568
The main change here is in `JvmInlineClassLowering.visitFunctionAccess`,
where we now store the substituted return type of the function as the
type of the call expression. Without it, the call could have a
meaningless type, e.g. some `T` which is inaccessible at that place, and
that could backfire in subsequent lowerings in codegen. For example, in
the `stringPlus.kt` test, it would prevent the code in
`FlattenStringConcatenationLowering.isStringPlusCall` from recognizing
and replacing the `String.plus` call, leading to a codegen exception.
Other changes are mostly cosmetics to make the code similar to
`visitFunctionReference`, and preventive optimizations for the case when
the substitution map is empty.