Commit Graph

107912 Commits

Author SHA1 Message Date
Igor Yakovlev 931cc48def [Wasm/WASI] Implementation of a callback on root exported function exit
Fixed #KT-64486
2024-01-15 11:37:37 +00:00
Sergey Bogolepov d3864c841a [Native][tests] Adapt to OutputDataFile constructor changes 2024-01-15 11:18:28 +00:00
Sergey Bogolepov b8c1da7d1f [Native][Tests] Disable static library tests of MinGW 2024-01-15 11:18:28 +00:00
Sergey Bogolepov 85490f9201 [Native][Tests]Update executable location in AbstractNativeCExportTest
Changed the code in AbstractNativeCExportTest to create the executable
in the same directory as the dynamic library.
This update is to accommodate the lack of rpath on Windows systems.
2024-01-15 11:18:28 +00:00
Sergey Bogolepov 8611851b2c [Native][Tests] Fix clang invocation on Linux and Windows
* Pass proper args from ClangArgs
* Call exe binary on Windows
2024-01-15 11:18:28 +00:00
Sergey Bogolepov 30c91e47a9 [Native][Tests] Always use -Xllvm-variant=dev
FileCheck tests force using dev LLVM distribution. It breaks
invocation of LLVM Clang which tries to look for executable in a wrong
directory. Let's keep things simple and always pass dev variant to our
tests.
2024-01-15 11:18:28 +00:00
Sergey Bogolepov 96e5b2be79 [Native][tests] Improve clang invocation
* Wrap it into a proper TestCompilationResult
* Pass additional flags in case of dynamic library test
2024-01-15 11:18:28 +00:00
Sergey Bogolepov 2ed84f6a11 [Native][Tests] Make it possible to run LLVM Clang
Not all K/N targets have Clang in their toolchain. Thus,
we need to run the one from LLVM in our tests.
2024-01-15 11:18:28 +00:00
Sergey Bogolepov c165171471 [Native][tests] Port KT-36639 test case to the new infra 2024-01-15 11:18:28 +00:00
Sergey Bogolepov 1c24f994db [Native][tests] Initial support for CExport in the new test infra
Very trivial implementation of CExport test infrastructure based on
work from LLDB tests and ObjCExport tests.
2024-01-15 11:18:28 +00:00
Sergey Bogolepov 13618fc03b [Native][tests] Extract Clang invocation to a separate function 2024-01-15 11:18:28 +00:00
Sergej Jaskiewicz e311b95893 FirOptInUsageBaseChecker: drop obsolete TODO (KT-59802)
Note: getAnnotationsOnContainingModule is no more in use in K1
2024-01-15 11:17:25 +00:00
strangepleasures 0dd3abba2a [KAPT] Support type annotations in K2 KAPT. Fixes KT-64479 2024-01-15 10:24:38 +00:00
strangepleasures 7e9d6e601d KT-64385 Enable K2 KAPT by default
Also adds support for front-end compiler plugins in Kapt
2024-01-15 10:22:32 +00:00
Anastasia.Nekrasova 8156c91c47 [K2]: Support java-kotlin interop for @SubclassOptInRequired
Previously, if the parent class was in Java code and the subclass in
Kotlin, the opt-in usage error would not be reported for the subclass.
The problem was that the extractClassFromArgument function couldn't get
the class type from Java code. It was looking for a ConeClassLikeType,
but found a ConeFlexibleType instead.

#KT-60258 Fixed
2024-01-15 09:43:08 +00:00
Yahor Berdnikau 9fafbc1b07 [Gradle] Add missing @MustBeDocumented annotation
We want @KotlinGradlePluginDsl annotation to be visible in published API
 reference.

^KT-64653
2024-01-15 09:42:16 +00:00
Timofey Solonin 0aa7b6f6ad Fix UnsafeNumber being applied incorrectly in hierarchical commonization
^KT-64376
2024-01-15 09:35:43 +00:00
Timofey Solonin 3c03e388d2 Record erroneous UnsafeNumber commonization behavior
^KT-64376
2024-01-15 09:35:43 +00:00
Dmitriy Novozhilov 29a1acffa3 [FIR2IR] Don't create setter symbol for f/o if the original setter is invisible
```
abstract class Base
    var x: Int
        private set
}

class Derived : Base()
```

Without this change, FIR2IR created a symbol for setter of f/o Derived.x,
  but IR f/o generator doesn't create a setter in f/o, as this setter is
  invisible in Derived

^KT-64742
2024-01-15 08:49:08 +00:00
Dmitriy Novozhilov f36ed93472 [FIR2IR] Remap fake-override symbols in forEachCachedDeclarationSymbol
^KT-64742
2024-01-15 08:49:08 +00:00
eugene.levenetc fc56f2af1c [ObjCExport] Fix top level property
KT-64923


Merge-request: KT-MR-13873
Merged-by: Eugene Levenetc <Eugene.Levenetc@jetbrains.com>
2024-01-15 01:49:37 +00:00
Sebastian Sellmair a713d66b7b [ObjCExport] Analysis Api: Ensure KDocs being exported by providing ObjCExportStubOrigin
^KT-64888 Fixed


Co-authored-by: Sebastian Sellmair <Sebastian.sellmair@jetbrains.com>


Merge-request: KT-MR-13854
Merged-by: Eugene Levenetc <Eugene.Levenetc@jetbrains.com>
2024-01-14 01:13:58 +00:00
Sergej Jaskiewicz a8914acb68 [FIR2IR] Insert implicit coercion to unit in adapted function references
^KT-60260 Fixed
2024-01-12 19:41:42 +00:00
Igor Yakovlev 99d5ee4db8 [stdlib] Replace usage of Enum.values with Enum.entries 2024-01-12 18:28:00 +00:00
Igor Yakovlev 2d08953c91 [stdlib] Remove unused kotlin.time.formatUpToDecimals 2024-01-12 18:28:00 +00:00
Igor Yakovlev 1e9bc1abc7 [Wasm/WASI] Use K/JVM implementation of MonotonicTimeSource
Fixed #KT-60963
2024-01-12 18:28:00 +00:00
Igor Yakovlev 567fc6b140 [Wasm/WASI] Make std random generator 64bit seeded
Fixed #KT-60962
2024-01-12 18:28:00 +00:00
Ilya Goncharov 84727f8d2b Upgrade yarn.lock 2024-01-12 17:04:54 +00:00
Denis.Zharkov 2db031d71e Drop unused createDeprecatedAnnotation
^KT-60858 Fixed
2024-01-12 16:59:42 +00:00
Andrey Yastrebov db27e29c08 fixup! KT-63592 Create setupLLDBScript task 2024-01-12 16:27:19 +00:00
Svyatoslav Scherbina 82f80a4899 Bump Kotlin/Native version in KGP to 2.0.0-dev-12398 2024-01-12 16:19:33 +00:00
Sergej Jaskiewicz 61e957fc00 [JS] Mute the EXPORTING_JS_NAME_CLASH_ES diagnostic in TS export tests
This diagnostic started to appear after
51c920af01e3d583c552224a529abe1f6e5fcf16.
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz eda30ff704 [klib] Implement diagnostics for clashing KLIB signatures
Now, we detect clashing signatures during serialization to KLIB and
report a compiler error if two or more declarations have the same
`IdSignature`

For example, for the following code:
```kotlin
@Deprecated("", level = DeprecationLevel.HIDDEN)
fun foo(): String = ""

fun foo(): Int = 0
```

the compiler will produce this diagnostic:
```
e: main.kt:1:1 Platform declaration clash: The following declarations
       have the same KLIB signature (/foo|foo(){}[0]):
    fun foo(): String defined in root package
    fun foo(): Int defined in root package
e: main.kt:4:1 Platform declaration clash: The following declarations
       have the same KLIB signature (/foo|foo(){}[0]):
    fun foo(): String defined in root package
    fun foo(): Int defined in root package
```

Note that we report this diagnostic during serialization and not earlier
(e.g., in fir2ir) for more robustness, so ensure that we check
exactly the signatures that will be written to a KLIB.
If we later introduce some annotation for customizing a declaration's
signature (e.g., for preserving binary compatibility), this
diagnostic will continue to work as expected.

^KT-63670 Fixed
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz e0cb145c6b [JVM] Split JvmSignatureClashDetector into two classes
One for methods, one for fields.
Later we are going to use the new `SignatureClashDetector` class
for detecting clashes of KLIB signatures.
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz e0f9e09a97 [JVM] Rename JvmSignatureClashDetector → JvmMethodSignatureClashDetector
This is to preserve the Git history of this file during the subsequent
refactoring.
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz c800144025 [IR] Add a new method to the IrDiagnosticReporter interface 2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz 2cee4ddf5c [JS] Use IrDiagnosticReporter in place of its more specific subclass
To reuse this diagnostic reporter in `serialization.common` for
reporting signature clashes (KT-63670), we must extract it to
the `serializeModuleIntoKlib` method instead of creating it in
`JsKlibCheckers`.

However, because `serialization.common` does not depend on
the `backend.common` module in which
`KtDiagnosticReporterWithImplicitIrBasedContext` is declared,
we have to use the `IrDiagnosticReporter` interface in place of
`KtDiagnosticReporterWithImplicitIrBasedContext`.

Besides, it's better from the architectural point of view:
the users of that diagnostic reporter should not know about its
implementation details.
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz 3430551681 [IR] Move IrElement#sourceElement to the ir.tree module
This is so that it could be used from more places.
Namely, we need to use it from the `serialization.common` module.
2024-01-12 15:59:28 +00:00
Sebastian Sellmair 9c3de4332f [ObjCExport] Run new ObjCExport tests as native tests on CI
^KT-64839 Fixed
2024-01-12 15:37:41 +00:00
Sebastian Sellmair 809b278a7b [Minor] Remove unnecessary backend.native/functionalTest/.editorconfig 2024-01-12 15:37:41 +00:00
Artem Kobzar de44905edd [Tests] Show all the missing artifacts in the ArtifactsTest instead of asserting one by one 2024-01-12 15:37:20 +00:00
Dmitriy Novozhilov 8300ad76d0 [FIR2IR] Remember overridden symbols if f/o contains error types
^KT-64837 Fixed
2024-01-12 15:32:25 +00:00
Roman Efremov 46cd5621bd [Test] Add test for two override-related diagnostics reported on one line
^KT-55433
2024-01-12 15:30:54 +00:00
Sergey Bogolepov 591e98a947 [KT-63275] Generate wrapper bodies in the SwiftExportExtension 2024-01-12 15:06:18 +00:00
Sergey Bogolepov cb19e291a3 [KT-63275] Implement trivial bodies in SIR functions 2024-01-12 15:06:18 +00:00
Sergey Bogolepov 5dd1d7c9c1 [KT-63275] Add a nullable body property to SIR functions 2024-01-12 15:06:18 +00:00
Sergey Bogolepov d54877be87 [KT-63275] Prepare SirAsSwiftSourcesPrinter for non-empty bodies 2024-01-12 15:06:18 +00:00
Alexander Shabalin 30550a6da1 [K/N] Immediately destroy objects that finalize only via ExtraObjectData ^KT-63423 2024-01-12 15:03:46 +00:00
Dmitriy Novozhilov 3c897ab20c [FIR2IR] Set opt-ins in FakeOverrideGenerator more granular 2024-01-12 15:01:49 +00:00
Dmitriy Novozhilov a11705186f [FIR2IR] Properly extract accessor symbols in FakeOverrideGenerator
^KT-64432 Fixed
2024-01-12 15:01:49 +00:00