Commit Graph

1732 Commits

Author SHA1 Message Date
Alexander Udalov d450e3074b IR: do not build fake overrides for static members of interfaces
Split members into static/non-static, and only build fake overrides for
inherited static members of classes.

 #KT-65276 Fixed
 #KT-65277 Fixed
2024-02-01 23:25:50 +00:00
Alexander Shabalin 0a4262d3ff [K/N][tests] Nonfatal timeout on draining streams on Windows ^KT-65113 2024-02-01 10:59:04 +00:00
Brian Norman dde2156f5f [FIR2IR] Always use property type if var
For destructing calls, the component type is used for the property type
in all cases. However, this can result in runtime and/or compilation
errors when the property is a var and changed, especially when the
component is a primitive but the property type is nullable. Instead,
only use the component type when the property is also a val.

^KT-64944 Fixed
2024-01-31 22:27:18 +00:00
Dmitriy Dolovov 1fe8b50c19 [Commonizer] Metadata comparator: treat type nullability properly
^KT-62753
2024-01-31 17:40:53 +00:00
Vladimir Sukharev 118a5cee06 [K/N][Tests] Cleanup tests code from old infra
^KT-61259
2024-01-31 16:17:21 +00:00
Vladimir Sukharev 2276abfb85 [K/N][Tests] Use GTest patterns for ignored tests
^KT-61259
2024-01-31 16:17:21 +00:00
Vladimir Sukharev 1ca79e645a [K/N][Tests] Use runProcess for code signing
^KT-61259
2024-01-31 16:17:21 +00:00
Vladimir Sukharev 524f0d335e [K/N][Tests] Migrate objcSmoke & objcTests tests
^KT-61259
2024-01-31 16:17:21 +00:00
Kirill Rakhman 853ad54699 [FIR] Fix incorrect updating of callable reference type in delegated property
... if the delegate happens to be a function call whose second
argument is a callable reference but not actually a provideDelegate
call.
The fix is to ensure that the call is _actually_ a desugared
provideDelegate call.

This fixes a CCE in a case where the delegate expression is a regular
function call and the second argument is a callable reference.

#KT-65165 Fixed
2024-01-31 14:51:51 +00:00
Sergej Jaskiewicz 03aa14b473 [klib] Use "IR signatures" i/o "KLIB signatures" in diagnostics
We already use the term "IR signatures" in other places.
2024-01-30 20:47:09 +00:00
Sergej Jaskiewicz 6900e20096 [klib] Fix exception for clashing signatures from different modules
If we encounter a declaration in the current module whose signature
is the same as that of a declaration in another module which we happen
to also reference from the current module, don't report any errors,
just like we don't do it in Kotlin/JVM. This leaves the user in the KLIB
hell situation, but this is intentional, because otherwise a legitimate
change like moving a declaration to another module and marking
the original one as `@Deprecated("", level = DeprecationLevel.HIDDEN)`
would lead to a error, and we don't want that.

Also, don't try to show the diagnostics on a declaration that doesn't
have an IrFile.

^KT-65063 Fixed
2024-01-30 20:47:09 +00:00
vladislav.grechko 8b1d87848d [FIR2IR] Fix unwrapping of single-statement blocks
Unwrapping should be done with respect to `forceUnitType` parameter.

^KT-65019: Fixed
2024-01-30 14:26:10 +00:00
Sergej Jaskiewicz f39335b3f7 [klib] Don't pass around metadata serialization closure
Pass the metadata serializer instance instead. This allows to further
reduce code duplication by introducing the common interface
`KlibSingleFileMetadataSerializer` for abstracting away K1 and K2
representation of a source file, as well as reusing
`Fir2KlibMetadataSerializer` across different backends.

KT-64392
2024-01-29 21:07:43 +00:00
Dmitriy Dolovov e021411768 [Commonizer] Metadata comparator: More verbose output (with more details)
^KT-62753
2024-01-29 17:34:55 +00:00
Dmitriy Dolovov 5f3eee7267 [Commonizer] Metadata comparator: Fully support contracts comparison
^KT-62753
2024-01-29 17:34:55 +00:00
Artem Olkov b317a88536 add Initial support for comments in SIR #KT-65174 Fixed
Merge-request: KT-MR-14007
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-29 14:22:42 +00:00
Alexander Shabalin ce291b45b9 [K/N][tests] Cache executors based on testTarget 2024-01-29 14:12:14 +00:00
Alexander Shabalin 65abb5de46 [K/N][tests] Remove now unused LocalTestRunner 2024-01-29 14:12:14 +00:00
Alexander Shabalin f2ba4a3e6e [K/N][tests] Use HostExecutor in new test infra 2024-01-29 14:12:14 +00:00
Artem Kobzar 1fe77705b0 [K/Wasm] Convert non-capturing lambdas into singletons ^KT-64803 Fixed 2024-01-29 12:52:18 +00:00
Artem Olkov de6a27aeeb KT-65123: move Swift Export Compiler Plugin into swift-export-standalone module
Merge-request: KT-MR-14031
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-29 10:32:09 +00:00
Alexander Shabalin c821c8fe6e [K/N] Add runProcess convenience function to executors 2024-01-26 22:18:05 +00:00
vladislav.grechko f318b5969d Erase non-reified type parameters by-default when inlining.
Substitution of type arguments to non-reified type parameters may lead
to accidental reification, which should not be done (see ^KT-60174 for
examples). So, we should erase them, except the few cases.

^KT-60174: Fixed
^KT-60175: Fixed
2024-01-26 18:31:20 +00:00
Denis.Zharkov ca80ddb8ca K2: Run completion-writer related PCLA tasks for irregular call kinds
- For synthetic calls
- For delegated constructor calls

Also, I checked that for each toResolvedReference() (beside annotations)
that converts candidate to the resolved reference,
we run `runPCLARelatedTasksForCandidate()` in the same context.

^KT-65103 Fixed
2024-01-26 18:13:27 +00:00
Sebastian Sellmair 0db8931026 [ObjCExport] Implement 'TodoAnalysisApi' annotation and run AA based tests as part of ':native:objcexport-header-generator:check'
^KT-65281 Fixed
^KT-65108 Fixed
2024-01-26 16:19:20 +00:00
Ivan Kylchik 69c83698fb [Native] Add K2 version of LLDB tests 2024-01-26 15:54:41 +00:00
Ivan Kylchik 2ded62c53e [Native] Drop LLDB_TRACE test directive
This directive doesn't have a lot of meaning. It is always set this
way that we are getting text file with the same name as test file.
2024-01-26 15:54:41 +00:00
Sebastian Sellmair c958aef679 [ObjCExport] Initial implementation of function type translation
^KT-65167
2024-01-26 10:11:48 +00:00
Sebastian Sellmair 3766a5f2ad [ObjCExport][Minor] Move 'isBinaryRepresentationNullable' utility to bottom of translateToObjCType.kt
^KT-65167
2024-01-26 10:11:48 +00:00
Sebastian Sellmair 9f0aa7d30c [ObjCExport] Use K1 convention and do not mark KtErrorType as nullable
^KT-65167
2024-01-26 10:11:48 +00:00
Sebastian Sellmair 2bf7bbb6c1 [ObjCExport] Support mapping of ObjCObject types to id
^KT-65167
2024-01-26 10:11:48 +00:00
Sebastian Sellmair 3cd20bd7b0 [ObjCExport] Support generic type parameters for ObjC translation
^KT-65167
2024-01-26 10:11:48 +00:00
Sebastian Sellmair 3111678f8b [ObjCExport] Support nullable type arguments in translating known Collection types
^KT-65167
2024-01-26 10:11:48 +00:00
Sebastian Sellmair 858af02a24 [ObjCExport] Initial support for inline classes in type mapping
^KT-65167
2024-01-26 10:11:48 +00:00
Sebastian Sellmair 262bfb18cc [ObjCExport] Initial support for ObjCClassType type arguments
^KT-65167
2024-01-26 08:19:05 +01:00
Sebastian Sellmair a6a27466fc [ObjCExport] Fix emission of 'ValueTypeBridge' for 'non primitive' types
^KT-65167
2024-01-26 08:19:05 +01:00
Sebastian Sellmair 8fbf0f21c8 [ObjCExport] Implement ObjCExportHeaderGeneratorTesttest - topLevelFunctionWithNumberReturn
^KT-65167
2024-01-26 08:19:05 +01:00
Sebastian Sellmair 1912ffded6 [ObjCExport] Implement ObjCExportTypeTranslationTest
^KT-65167
2024-01-26 08:19:05 +01:00
Svyatoslav Scherbina 2e5a9b1416 [K/N] Make cinterop include unused Objective-C forward declarations
Previously, when an Objective-C library had an unused Objective-C
forward declaration (`@class` or `@protocol`), cinterop tool didn't
include it into the resulting klib at all.

This led to a subtle bug (KT-64105). One Obj-C library has unused
Obj-C forward declaration, and another one depends on the first and
uses this forward declaration, e.g. as a function result type.
When building the first cinterop klib, this forward declaration is not
added to `includedForwardDeclarations` in the klib manifest (the
compiler uses this property to decide whether to synthesize the
corresponding class).
When building the second cinterop klib, the forward declaration is not
added to its manifest either, because it is located in the dependency
(and therefore should've been included there).
As a result, the forward declaration is included nowhere, and any
attempt to use it in Kotlin fails, including calling the function from
the second lib.

This commit fixes this bug by including even unused Objective-C forward
declarations, which is consistent with any other kind of declarations
and seems more natural.

^KT-64105 Fixed
2024-01-25 14:06:10 +00:00
Svyatoslav Scherbina 59142b3051 [K/N][tests] Fix using objcnames package in grouped tests
Native test infra groups individual tests into compilations, so it
renames packages, patching package and import directives, to avoid
clashes.
This doesn't include "standard" packages. They are distinguished by a
predicate defined in the test infra. This predicate didn't include
`objcnames.*` -- synthetic package provided by the compiler.
As a result, tests importing from `objcnames.*` got those import
directives patched, which was unexpected and could make tests fail.

This commit fixes the problem, making `objnames.*` recognized as
a "standard" package.
2024-01-25 14:06:10 +00:00
Svyatoslav Scherbina ffb0b063a8 [K/N][tests] Support dependencies for cinterop modules
When building cinterop klibs, cinterop tool can accept dependencies,
which affects the way it processes the native library.
The test infrastructure allowed to specify cinterop module dependencies,
but didn't actually pass them to the tool.
This commit fixes that.
2024-01-25 14:06:10 +00:00
Alexander Shabalin ab503d0aff [K/N] More debug output in HostExecutor for Windows ^KT-65113 2024-01-24 13:53:29 +00:00
Alexander Shabalin 5ee726558f [K/N] Workaround waitFor in HostExecutor for Windows ^KT-65113 2024-01-24 13:53:29 +00:00
Alexander Zakharenko f502edd1de [K/N] Debug output for flaky test
Compiler output for testReleaseCompilerAgainstPreReleaseLibrary added

^KT-64822
2024-01-24 11:43:21 +00:00
Mikhail Glukhikh 51093a4764 K1/K2: add a group of BB test around primitives in Java
Related to KT-62554, KT-63242
2024-01-24 08:39:18 +00:00
Alexander Shabalin ebef991477 [K/N] Workaround hanging during stream draining ^KT-65113 2024-01-23 16:05:34 +00:00
Alexander Shabalin d04b3050c0 [K/N] Remove old workaround for osVersionMin on arm macOS 2024-01-23 11:14:38 +00:00
Sebastian Sellmair 2708c74d9c [ObjCExport] Fix KT-64952 HasErrorTypesTest 2024-01-23 10:03:15 +00:00
Dmitrii Krasnov 7165d15d59 [Gradle Native] Added Kotlin Native Provider to all native tasks
This provider is a first step of "Kotlin Native Toolchain".
This solves several problems:
1) Resolving K/N bundle during configuration phase ->
now it happens during execution phase
2) Downloading K/N bundle with internal mechanisms ->
now it uses Gradle dependency resolvers and Transform Artifact

^KT-58303
^KT-52567
^KT-49268
2024-01-22 20:26:24 +00:00
eugene.levenetc 480b8ec516 [ObjCExport] Add object translation and error handling
- Also add forward declaration tests
- Add hidden types support
- Issues: KT-64857, KT-64952, KT-65080
2024-01-22 14:59:56 +00:00