3aa84906 changed native metadata serialization to use proper platform
session, but it caused a new bug: FirKLibSerializerExtension uses
FirProvider from the passed session to get a containing file of
serialized declaration to put some extension into the metadata. And
platform session doesn't contain information about any declarations
except platform ones
So it's needed to use the proper FirProvider in it, which can be
extracted from Fir2IrComponents. This provider contains providers from
all sessions that are being compiled plus providers for top-level
declarations generated by compiler plugins
^KT-65024 Fixed
^KT-59074 Fixed
This solution is not ideal. Ideally, the allopen compiler plugin
shouldn't report `private` properites as `open` KT-64980, but it will
unpredictably break other things.
For some reason, codegen box test was not added in 082c337faa. The main
point of it now is to check that everything works correctly in the
IrFakeOverrideBuilder mode.
Fir-based lazy type alias is required in IR text tests to check that
lazily loaded IR is equivalent to deserialized IR (module bodies)
and does not cause ABI compatibility issues in KLIB-based backends.
^KT-65033
This commit adds support for the Parcelize plugin to generate default
serialization implementation for the kotlin.time.Duration. As Parcelize
already supports serializing some of the kotlin library types it makes
sense to support more common ones for the user convenience.
https://issuetracker.google.com/issues/264614661
Affects IR Evaluator in IDEA.
The problem is happening because
`ReflectiveAccessLowering#fieldLocationAndReceiver` returns the class
the field was called on, not the class the field was declared in.
Then the class is used for obtaining a field by using reflection's
`getDeclaredField` to make the field accessible after.
But `getDeclaredField` doesn't work for field declared in a superclass,
hence the error.
#KT-65012 fixed
Merge-request: KT-MR-13919
Merged-by: Alexander Kuznetsov <Aleksander.Kuznetsov@jetbrains.com>
N.B. This implementation does not 100% prevent conflicts or resolve
alterations when shortening functions.
To guarantee that,
we would need to carefully consider all the references in the file,
and to check whether they have changed their resolve in the presence
of a new import.
This is not trivial and will be approached separately under a different
task.
^KTIJ-27841 Fixed
For the correct work of the compiler, some maps should be fulfilled by the build system. In the first implementation of dumb mode for JPS all maps were disabled. Now flag was introduced to determine IC behavior: to collect data needed for the compiler's code generation and disable maps and IC analysis
^KT-65043 Fixed
This fixes some type argument mismatch errors caused by a captured type
being approximated and then captured again.
Some places need to be adapted to work with captured types that
previously only worked with approximated types.
#KT-62959 Fixed
This is in preparation of a future commit, where captured types won't be
approximated anymore after completion.
Consider a case like
class Box<T>(val value: T)
interface Foo<T> { fun bar() }
fun test(x: Box<out Foo<*>>) {
x.value.bar()
}
The type of `x.value` will be `CapturedType(out Foo<*>)`.
Note that capturing only applies to the top level, i.e., nested
projections are not captured.
That's why it becomes necessary to support capturing of captured types,
otherwise the star projection in `CapturedType(out Foo<*>)` is not
properly captured in the receiver of the call `x.value.bar()`.
#KT-62959