^KT-52050 Verification Pending
The issue described in KT-52050 happened, because forwardDeclarations
were not carried into next commonization steps. For commonization
it is fair to choose the union of all modules forwardDeclarations
as common dependency (instead of a union), since we can assume that
all those forward declarations will be provided.
Get distribution and home path in the test to simplify gradle build.
Using NativeCompilerDownloader in the build led to the undesired results
where test get old K/N compiler from the bootstrap, also blocking K/N
version class development.
1. Extension functions declared in data classes are generated earlier by `generateMembersDeclaredInClassBody`
2. Extension functions fake override from parent class are generated earlier by `generateFakeOverrideMemberDeclarations`
So it is safe to filter out extension functions inside `generateAdditionalMembersForDataClass`
#KT-49715
#KT-51798
If we do not do this, the state-machine builder will not know the type
of the ACONST_NULL, defaulting to Object, leading to VerifyError.
Alternatively, we could use LVT to deduce the type, but getting types
from LVT is something I got rid of long time ago, and I have no desire
to return it back.
Generating CHECKCAST hints the state-machine builder the type of the
variable avoiding the issue of VerifyError. However, this CHECKCAST
replaces StrictBasicValue.NULL_VALUE with BasicValue in
OptimizationBasicInterpreter. To preserve optimization on not-spilling
known nulls, introduce BasicValues, which represent typed nulls and
create BasicInterpreter, which is aware of them. This way we have the
best of two worlds - we do not spill known nulls, and we know the type
of ACONST_NULL.
#KT-51718 Fixed
Previously it was like "null cannot be cast to MyObject" or
"MyObject cannot be cast to null", because `KClass.qualifiedName` is
`null` for local classes (including anonymous ones).
Use `KClass.toString()` instead, for both object actual dynamic type
and cast target type. This string representation is generally more
meaningful for such cases, and contains useful details for local
classes.
After commonization a type might additionally reference a abbreviated
type which is not present in the reference module's metadata.
This was even considered 'OK' before this commit, however only
under a special condition which might be too strict.
Right now, this newly introduced test will only enter the
newly allowed branch. This shall be re-reviewed later.
KT-51686
If the same NullableSingleInvocationCommonizer is reused for any reason,
it will store next inputs alongside previous, which is totally not
expected
^KT-51528 Fixed
Incorrect `valueParameter` was passed to `generateValueArgument`, which
resulted in incorrect type being considered for generating suspend
conversion.
#KT-50949 Fixed
Commonized type should match the platform's `platform.posix.ssize_t`
type alias' width. The implementation hard-codes platform widths for
all the targets, this can be potentially changed to search for ssize_t
in dependencies and get width from its type.
Use real targets in platform int commonization tests.
KT-41509
- Fix the predicate used for finding the member function `next`: check
that there's no extension receiver parameter, don't filter out
abstract functions.
- Do not copy iterator expression, instead change the type in all
references to the iterator variable.
- Fix some style issues.
#KT-47171 Fixed
Always serialize type table (and version requirement table) after
everything else, to prevent bugs like KT-51446 where inline class
underlying type was added to the type table after it has already been
serialized.
#KT-51446 Fixed