Commit Graph

99004 Commits

Author SHA1 Message Date
Yahor Berdnikau 473a2dc87c Fix KaptGenerateStubsTask freeCompilerArgs duplication
Now this task uses configured freeCompilerArgs both from itself and from
 linked KotlinCompile task. When these tasks are configured with the
 same value this leads to freeCompilerArgs duplication.

Added workaround is to use linked KotlinCompile freeCompilerArgs as
convention value for KaptGenerateStubsTask. Proper fix will be done via
KT-54468.

^KT-55452 Fixed
^KT-55565 Fixed
2023-02-24 09:20:23 +00:00
Yahor Berdnikau a49906f4e4 Bump AGP dependency version to 4.2.2
^KT-56454 Fixed
2023-02-24 09:17:47 +00:00
Yahor Berdnikau db5589121d Bump minimal supported AGP version to 4.2.2
^KT-56454 In Progress
2023-02-24 09:17:47 +00:00
Svyatoslav Kuzmich 321a476898 [Wasm] Add external inheritance checker.
Prohibit non-external types to extend external types.
This type of inheritance is not supported in Wasm backend.
2023-02-24 01:05:23 +01:00
Svyatoslav Kuzmich 54a45c49f8 [Wasm] Add Wasm platform and K1 FE infrastructure 2023-02-24 01:05:23 +01:00
Anton Lakotka fa4bbdf6d6 [Gradle] Avoid configuration resolution in MPP projects
Add `getResolvedArtifactsCompat` for compatibility with gradle <7.4
However configurations are still resolved in these gradle versions

^KT-51940 Verification Pending
2023-02-23 17:59:56 +00:00
Ilmir Usmanov b3890885c4 JVM: Break infinite loop in finding meaningful instruction
during tail-call optimization.

There can be code, where all next instructions are non-meaningful and
there is a back-edge, for example, while(true){}. Previously, analyzer
incorrectly assumed, that this cannot happen. Now, it keeps track of
visited instructions and says, that there is no meaningful instruction
in such case.
 #KT-56815 Fixed
2023-02-23 17:54:46 +00:00
Dmitrii Gridin 550b4f1f11 [SLC] throw exception on redundant test data file 2023-02-23 17:15:53 +00:00
Pavel Mikhailovskii 9204f8162e [SLC] Fix modifiers for @JvmStatic methods in interfaces 2023-02-23 17:04:22 +00:00
Simon Ogorodnik 253cdb1b8f KT-56789: Fix memory leak in CoreJrtFileSystem
CoreJrtFileSystem uses JrtFileSystemProvider provider to read contents
of jrt-fs from JDK
Implementation of FileSystems.newFileSystem causes metaspace memory leak
that wasn't fixed until JDK 17, see
https://bugs.openjdk.java.net/browse/JDK-8260621

When FileSystems.newFileSystem used to create jrt-fs on JDK9 with
provided java.home value it creates new ClassLoader under-the-hood,
which subsequently leaks due to aforementioned bug

Remove conditional usage of `java.home` + FileSystems.newFileSystem and
switch to use jrt-fs classloader cache regardless of
compiler runtime JDK to reduce classloader leaks

^KT-56789
2023-02-23 15:55:24 +00:00
Igor Chevdar 0f384f5878 [K/N][IR] Workaround for off-scope type parameters
#KT-56500 Fixed
2023-02-23 15:32:25 +00:00
Igor Chevdar 5d3b61364a Added a test for KT-56500 2023-02-23 15:32:25 +00:00
Vladimir Sukharev 7c9e567496 [K2/N] KT-56028: Enable and patch test interop_kt49034_objcclass
Merge-request: KT-MR-8942
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-23 13:08:33 +00:00
Pavel Mikhailovskii 378bb4c4ac KT-56891 SLC Don't include abstract members in DefaultImpls 2023-02-23 12:50:59 +00:00
Dmitriy Novozhilov 331cc1465a [FE] Properly parse java class name from sources if java class has annotations
^KT-56847 Fixed
2023-02-23 12:14:15 +00:00
Jinseong Jeon 5455942859 AA: handle underscore as type arguments
^KTIJ-24742 Fixed
2023-02-23 13:02:34 +01:00
Alexander Udalov d73d3c46e2 K2 JVM IR: fix access to Java field shadowed by Kotlin property
#KT-56386 Fixed

Co-authored-by: Mikhail Glukhikh <Mikhail.Glukhikh@jetbrains.com>
2023-02-23 12:54:00 +01:00
Alexander Udalov 641d636c45 JVM IR: improve generation of receiver for bound callable references
Trick codegen into generating getfield from the anonymous class instead
of its supertype (e.g. kotlin.jvm.internal.FunctionReference,
PropertyReference or AdaptedFunctionReference). This gets rid of
unnecessary accessors in some cases, and will help in the subsequent
commit that changes logic around access to fields from Java
superclasses.
2023-02-23 12:54:00 +01:00
Alexander Udalov 4ad594a3cd Minor, move tests about Java field and Kotlin property
Because the `fieldRename` directory was originally about cases when
private fields are renamed because of clashes.
2023-02-23 12:54:00 +01:00
Dmitriy Dolovov 4b1f739c89 [PL] Don't use trove4j in partial linkage 2023-02-23 11:40:19 +00:00
Svyatoslav Scherbina 22ee170f44 [K2/N] Prohibit single-stage compilation with language version 2.0
Kotlin/Native compiler can compile source files directly to a native
binary (e.g. an executable or a framework). This is the so-called
"single-stage" compilation mode. It is used only in the command-line
compiler, while Kotlin Gradle plugin always produces an intermediate
klib first, and then compiles it to a native binary ("two-stage"
compilation mode).

When running Kotlin/Native compiler with '-language-version 2.0' in the
single-stage compilation mode, it in fact doesn't use the new K2
frontend. This is misleading and error-prone.

To address this problem, the commit prohibits the single-stage
compilation with '-language-version 2.0'. This affects only the
command-line compiler, and shouldn't affect compilation with Gradle.

^KT-56855
2023-02-23 11:36:38 +00:00
Aleksei.Cherepanov 25b6eb3114 [Maven] Add tests for K2
#KT-56903 Fixed

Co-authored-by: Ilya Gorbunov <Ilya.Gorbunov@jetbrains.com>

Merge-request: KT-MR-8922
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-02-23 11:24:20 +00:00
Pavel Kunyavskiy b306ed53aa [K/N] Support Enum entries in objc export
^KT-53653
2023-02-23 10:49:25 +00:00
Pavel Kunyavskiy b4bd847345 [K/N] Refactor ObjcExportTest build script 2023-02-23 10:49:25 +00:00
Ilya Gorbunov 69b90e107c Fix missing native-wasm source set in legacy docs build 2023-02-22 23:52:43 +00:00
Ilya Gorbunov 5a2d557839 docs: specialize build for latest version
- leave only the latest version in versions list
- remove conditions for previous versions
- merge JVM7/8 source sets into JVM
2023-02-22 23:52:43 +00:00
Ilya Gorbunov ba6732ac17 Render kotlin-reflect library documentation in a separate module 2023-02-22 23:52:42 +00:00
Ilya Gorbunov d695b0eac4 Setup multi-module docs build task 2023-02-22 23:52:42 +00:00
Ilya Gorbunov 6236a1fe64 Determine snapshot version automatically from root gradle.properties 2023-02-22 23:52:42 +00:00
Ilya Gorbunov e3cfed8ced Allow to specify target and templates directory with Gradle properties 2023-02-22 23:52:41 +00:00
Ilya Gorbunov 6d3ddb999f Migrate to Gradle KTS, step 3: extract more common extension helpers 2023-02-22 23:52:41 +00:00
Ilya Gorbunov 65dbc1c98a Migrate to Gradle KTS, step 2: fix syntax 2023-02-22 23:52:41 +00:00
Ilya Gorbunov 63eaf3f86f Migrate to Gradle KTS, step 1: rename 2023-02-22 23:52:40 +00:00
Ilya Gorbunov ef02b47348 Update Dokka to 1.8.0-dev-195
- Build dokka plugins with Kotlin 1.8 (required to compile with Dokka 1.8)
2023-02-22 23:52:40 +00:00
Ilya Gorbunov e8139043b2 Remove workaround for removing SinceKotlin from enums
No longer needed with the modern Dokka
2023-02-22 23:52:40 +00:00
Ilya Gorbunov 95f21075fe Inline project with kotlin-native path settings 2023-02-22 23:52:40 +00:00
Ilya Gorbunov 2cfbbb185d Change docs artifacts directory layout for easier publishing
Change module names of libraries to be consistent
2023-02-22 23:52:39 +00:00
Ilya Gorbunov e105d11a2b Documentation source sets configuration tuning
- consistent naming of source sets
- register JDK7/8 docs source sets only since 1.2
- source set dependencies in kotlin-test module
- classpath tuning
  - Enumerate classpath jars in library directories:
    compiler can't use just directory as a classpath
  - No need to pass classpaths for stdlib docs build:
    it's analyzed from sources and doesn't have other dependencies
2023-02-22 23:52:39 +00:00
vmishenev a758e0bae7 Disable ignoreCommonBuiltIns in kotlin.test 2023-02-22 23:52:39 +00:00
Ilya Gorbunov fbe1aff961 Extract repeating parts of configuration 2023-02-22 23:52:38 +00:00
Ilya Gorbunov e94ca37bd6 Rectify docs task dependencies
Introduce kotlin-test->stdlib doc task dependency due to package-list and fix package-list local path
2023-02-22 23:52:38 +00:00
vmishenev e94818a1cb Setup project for docs build with new Dokka
- Update Dokka to 1.6.20-M1
- Update Dokka to 1.6.20
- Update Dokka to 1.7.0-dev
- Update Dokka to 1.7.20-dev-187

Co-authored-by: ilya.gorbunov@jetbrains.com
2023-02-22 23:52:38 +00:00
Ilya Gorbunov 9bceb6cd0a Move/copy legacy docs build to a separate directory 2023-02-22 23:52:37 +00:00
Alexander Udalov 1cb77a47ec Fir2Ir: extract error about unsupported mutation 2023-02-22 22:40:34 +00:00
Alexander Udalov 22b4b29292 IR: make most properties mutable 2023-02-22 22:40:34 +00:00
Alexander Udalov d2938e732a IR: remove IrTypeOperatorCall.typeOperandClassifier 2023-02-22 22:40:34 +00:00
Alexander Udalov 42daeaaa80 IR: remove IrCallableReference.referencedName
It was added in 66da676b9e to avoid dependency on descriptors, but now
it doesn't use descriptors anyway, so it's better to inline it than have
it in the interface.
2023-02-22 22:40:33 +00:00
Alexander Udalov d286409b76 IR: make IrComposite.isTransparentScope an extension 2023-02-22 22:40:33 +00:00
Sergey.Shanshin 63025030e3 [KxSerialization] Fix SERIALIZER_NOT_FOUND diagnostic for enums
Fixes #KT-56738

Merge-request: KT-MR-8938
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-02-22 19:38:18 +00:00
Ilya Goncharov 4ccad00c11 [Gradle, JS] Force enabled js compiler legacy to prevent problems in daemon 2023-02-22 13:56:15 +00:00