This change adds a library with cinterop that has XCTest wrapper around
Kotlin/Native tests (that are @kotlin.test.Test marked methods).
This library can be compiled with either test code using the option
`-produce test_bundle` to make a loadable test bundle or used inside
the existing ObjC/Swift tests if compiled to a framework.
The basic idea is to make XCTest be able to resolve separate test cases
and correctly show them in test reports. This was achieved by wrapping
test cases with dynamically created invocation methods. Test listeners
are integrated with XCTest Observation to make it possible to have
the same ability to report with GTest or TeamCity logging.
Gradle build files use MPP Gradle plugin and use a bootstrap version
of K/N. Property `kotlin.native.home` was moved to the kotlin-native
subproject to not override this project's K/N distribution, that is
being used by the KGP with the same property.
This is a part of ^KT-58928
Merge-request: KT-MR-13268
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
We are using `ConeKotlinType` instead of `FirTypeRef` to represent
that element type of vararg doesn't have any source. It has a type
that was inferred. If we try to specify a source, then we could
end up with the incorrect place for diagnostic.
#KT-59682 Fixed
This fixes a compiler crash
IllegalStateException: Captured type for incorporation shouldn't escape
from incorporation
The crash occurs when a captured type with status FOR_INCORPORATION
is two layers deep inside a captured type with status FROM_EXPRESSION.
We first check if approximation is required for the most outer captured
type in AbstractTypeApproximator.approximateCapturedType.
Then we encounter the second captured type with status FROM_EXPRESSION
in AbstractTypeApproximator.approximateParametrizedType.
At this point, we stop checking and miss the third captured type with
status FOR_INCORPORATION.
Unfortunately, we can't check recursively if nested captured types
need to be approximated because of types with recursive super types
(the original reason why the extra check was introduced).
That's why we restrict the second check to types with recursive
super types, effectively restoring the previous behavior for all other
types.
#KT-65050 Fixed
This is necessary to prevent exponential growth of the attribute
structure.
Since we usually care for the most inner value of a
ConeAttributeWithConeType like EnhancedTypeForWarningAttribute, this
shouldn't alter any behavior.
The error-level enhancement is kept as warning-level and a new
LanguageFeature is introduced to turn the warning into an error.
#KT-63208 Fixed
#KT-63209
(cherry picked from commit 371b1eb3d5)
This is required for EnhancedTypeForWarningAttribute because scopes
should not be reused between cone types with different values of
this attribute.
#KT-63208
(cherry picked from commit 9189154cae)
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