Commit Graph

109329 Commits

Author SHA1 Message Date
Mikhail Glukhikh 34877130c7 Refactor callableId around pathToLocal and classId properties
#KT-58739 Fixed
2024-01-15 18:46:51 +00:00
Ivan Kylchik 71f2a2df8e [Tests] Drop JVM_WITH_OLD_EVALUATOR and JVM_WITH_IR_EVALUATOR targets
These targets were used in plugin, but not anymore.
2024-01-15 17:30:57 +00:00
Sergej Jaskiewicz 2e6b7a3856 [atomicfu] Don't create Volatile's constructor for each call site
^KT-64971 Fixed
2024-01-15 17:28:22 +00:00
Alexander Popoff ddd71851cf MPP / KJS: Fix incorrect source maps generating for ESM target
(cherry picked from commit 0553a2bf12b35f33f30c6400ab3af14341877946)
2024-01-15 16:03:26 +00:00
Anastasia.Nekrasova ad9025afa6 [k1/K2]: Mark @SubclassOptInRequired as an experimental
At the moment, SubclassOptInRequired is marked with the
ExperimentalSubclassOptIn annotation. However, it does not work
as expected due to a missing opt-in error. To use SubclassOptInRequired,
an explicit opt-in is necessary because SubclassOptInRequired is an
unstable feature now.

^KT-64739
2024-01-15 14:54:36 +00:00
Pavel Kunyavskiy 882dc18e0e [IrActualizer] Don't copy attributeOwnerId in actualizer
In before, actualizer was copying attributeOwnerId to new
nodes. This leads to attributeOwnerId linked to non-actualized
node. It's unclear what it leads to, so we just stop doing that.

In particular, if attributeOwnerId references another node,
this information would be lost.

^KT-64895
2024-01-15 14:10:35 +00:00
Sergej Jaskiewicz e49b28d639 [FIR] Disable linkViaSignatures in K2 irText tests for non-JVM targets
This will make the test compiler configuration closer to the production
configuration.

KT-64809
2024-01-15 13:13:55 +00:00
Sergej Jaskiewicz a5031edd1a Verify mangled names against descriptions of signatures computed from IR
...instead of those computed from a frontend representation
(`symbol.signature`).

This is more robust; besides, we are going to turn off building
signatures from FIR, so `symbol.signature` is going to return null soon.
2024-01-15 13:13:55 +00:00
Sergej Jaskiewicz c8f8316e9b [klib] Return the block's return value in inFile methods 2024-01-15 13:13:55 +00:00
Sergej Jaskiewicz da9f0e7af8 [test] Get rid of SKIP_SIGNATURE_DUMP directive in irText tests
Sometimes there are legitimate reasons to have two separate signature
dumps for K1 and K2.

^KT-61797 Fixed
2024-01-15 13:10:19 +00:00
Alexander Shabalin d2cf4548f6 [K/N] Fix ExtraObjectData not being collected ^KT-63423 2024-01-15 13:04:37 +00:00
Kirill Rakhman 76898ddb0f [FIR] Make EnhancedTypeForWarningAttribute a data class 2024-01-15 12:23:27 +00:00
Kirill Rakhman 9b4ebc31c1 [kapt] Fix new compilation warnings after #KT-63208 2024-01-15 12:23:27 +00:00
Kirill Rakhman dc0f4e6995 [FE 1.0] Fix new compilation warnings after #KT-63208 2024-01-15 12:23:26 +00:00
Kirill Rakhman 8bfc4675c4 [FIR] Fix parameter order of NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS 2024-01-15 12:23:26 +00:00
Kirill Rakhman 371b1eb3d5 [FIR] Don't lose error level enhancements in warning-level-enhanced arguments
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
2024-01-15 12:23:26 +00:00
Kirill Rakhman 9189154cae [FIR] Let attributes opt-in to participating in ConeClassLikeTypeImpl structural equality
This is required for EnhancedTypeForWarningAttribute because scopes
should not be reused between cone types with different values of
this attribute.

#KT-63208
2024-01-15 12:23:26 +00:00
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