Commit Graph

105059 Commits

Author SHA1 Message Date
Aleksei.Cherepanov a32c65e4e1 Convert absolute to relative pluginsClasspath..
..to avoid recompilation on build with portable caches

#KT-62256 Fixed


Merge-request: KT-MR-12377
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-10-05 10:25:53 +00:00
Vladimir Sukharev 7b3e661776 [FIR] Fix Disappeared ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT
^KT-59942 Fixed
2023-10-05 10:18:09 +00:00
Mikhail Glukhikh c860de6600 Use bootstrapped Native bundle with pre-release ON to fix Gradle tests
Related to KT-62058
2023-10-05 09:58:29 +00:00
Mikhail Glukhikh 52010e38e3 Temporarily mute failing tests around IS_PRE_RELEASE (related to KT-62058)
These tests should be fixed by bootstrapping
2023-10-05 09:58:29 +00:00
Mikhail Glukhikh 9bb1a0a31d LV 2.0: set KotlinCompilerVersion.IS_PRE_RELEASE to true
#KT-62058 Fixed
2023-10-05 09:58:29 +00:00
Svyatoslav Scherbina e22d9821e2 Native: fix kotlin-native/performance/framework build script for K2
The build script manually specifies which directories are parts of
which source sets. And it did that wrong: all directories were just
added to the nativeMain source set.
This was an incorrect configuration (matching expect and actual were
getting into the same source set), and K2 compiler was not really happy
with that.

This commit fixes the correspondence between source sets and source
directories in kotlin-native/performance/framework build script, thus
fixes the build for that benchmark with K2.
2023-10-05 09:17:58 +00:00
Svyatoslav Scherbina 4672727bd6 Native: enable K2 for benchmarks in performance/
Those benchmarks are built with bootstrap KGP and snapshot compiler.
Currently the former is K1, while the latter is K2. As a result, the
build fails because K2 compiler needs -Xfragment-sources argument,
while K1 uses -Xcommon-sources. So KGP passes the latter, while the
compiler expects the former.

Fix this by forcing KGP to use K2 for benchmarks in performance/
This can be reverted once bootstrap is updated to 2.0.0.
2023-10-05 09:17:58 +00:00
Nikolay Lunyak cca04bbcc2 [FIR] Check test text for all alongside tests
For some reason the practice is to configure the K2
diagnostics tests as "alongside" and instruct K1
tests to ensure there are no unexpected differences
in the sources. But someone may still forget there is
something that they need to configure in the K1 runners.
2023-10-05 08:46:54 +00:00
Mahdi Hosseinzadeh d803e0e31c Fix a grammatical issue in String::isNotBlank docs
"except of ..." is wrong.
Instead, it should be either of the following:
  - "except ..."
  - "except for ..."
  - "with the exception of ..."

See https://www.merriam-webster.com/dictionary/except%20for
and https://ell.stackexchange.com/q/148197
2023-10-05 03:56:05 +00:00
Brian Norman 365ce2a6a5 [FIR] Implement checker for missing dependency supertypes
#KT-60778 Fixed
2023-10-04 21:57:43 +00:00
Pavel Punegov a72eafc92b [K/N][test] Fix cache mode selection for test targets without cache
Execution of tests without cache support should be restricted. Such runs
should use default cache mode (without).
2023-10-04 19:21:51 +00:00
Vladimir Sukharev cd4c241fa3 [K/N] Run irText tests for K2/Native
^KT-58240
2023-10-04 18:20:05 +00:00
Stanislav Erokhin 0cfa721585 [KMP] Remove experimental from -Xmulti-platform flag
#KT-61686
2023-10-04 18:19:35 +00:00
Ilmir Usmanov e5aa737eaf Do not trim getType from com.intellij.lang.jvm.JvmParameter
Since K2 KAPT uses this API, absence of class bodies in classes
from the package leads to java.lang.NoSuchMethodError

 #KT-61879 Fixed
2023-10-04 17:15:05 +00:00
vishwajeet.barve 28fabf06fc Native: update README to reflect that build time depends on system configuration (#5189)
Co-authored-by: vishwajeet.barve <vishtech36@gmail.com>
2023-10-04 14:59:54 +00:00
Vladimir Sukharev 03442e1cee [FIR] Implement FirGenericArrayClassLiteralSupport platform feature
^KT-59931 Fixed
2023-10-04 14:45:23 +00:00
Vladimir Sukharev 9ab6353032 [FIR] Fix some Disappeared CLASS_LITERAL_LHS_NOT_A_CLASS
^KT-59931
2023-10-04 14:45:23 +00:00
Sebastian Sellmair 1dad890652 [Gradle][KMP] Remove top level and target level compilerOptions APIs
as those experimental APIs have shown to negatively affect usages
of stable APIs (because of resolve confusion), whilst also
failing to address popular use cases.

KT-61636
KT-61355
KT-61368
2023-10-04 12:23:39 +00:00
Artem Kobzar eef57f216c [K/JS] Rework main function call to support it in per-file 2023-10-04 12:13:20 +00:00
Roman Efremov faae5f9b38 [IR] Fix annotation arguments comparison when expression is expect enum
...actualized via typealias. This caused false-positive report of
`ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE`.
In such case it's incorrect to compare signatures, because classes have
different `ClassId`s. Instead, classes could be compared using
`areCompatibleExpectActualTypes` which actualizes both types, and
then enum value names compared.

^KT-62104
^KT-59940
2023-10-04 11:38:15 +00:00
Roman Efremov 67a46eba9c [FIR2IR] Fix default value conversion in annotation classes
This fixes failing test
`FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.DefaultArguments.testAnnotationsViaActualTypeAlias2`.

It started to fail after commit 4e08cafc78
"[FIR2IR] Get rid of IrSymbol.owner usages in Fir2IrLazyClass"
where in Fir2IrLazyClass `declarationStorage.getIrConstructorSymbol`
was changed to `declarationStorage.getOrCreateIrConstructor`.

Before change, value parameters were initialized in
`Fir2IrLazyConstructor#valueParameters` where
`forcedDefaultValueConversion` was passed.
After the change parameters via
`Fir2IrCallableDeclarationsGenerator.declareParameters` where
`forcedDefaultValueConversion` is not passed to method.

^KT-62104 Fixed
2023-10-04 11:38:15 +00:00
Roman Efremov 705b2e87fd Revert "[K2] Temporary mute ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE"
This reverts commit b232dbf484.
2023-10-04 11:38:15 +00:00
Mikhail Glukhikh 8bd792792f K2: consider backing fields of vars as smartcast unstable
#KT-61974 Fixed
2023-10-04 10:12:57 +00:00
Mikhail Glukhikh 8e577e101e K2: reproduce KT-61974 2023-10-04 10:12:57 +00:00
Dmitry Savvinov 0d98995a8e [build] Fix regex in verification-metadata.xml for kotlin-native
Regex OR ('|') has weird precedence rules and previous version of regex
were essentially checking two alternatives:
- kotlin-native-prebuilt-.*-1\.9\.3[0-9](-.+)?
- 2\.0\.0(-.+)?

This is obviously incorrect, but it won't manifest on machines that
already downloaded that artifact to `.konan` via the build without
verification-metadata.xml
2023-10-04 10:04:07 +00:00
Timofey Solonin 8dc9307f9e Add iconv void * overloads for backwards compatibility
Since Xcode 15 the iconv APIs operate on an opaque type __tag_iconv_t* instead of
void*. This causes a runtime exception in older Ktor versions which
depended on iconv.

^KT-62286
2023-10-04 08:04:37 +02:00
Egor Kulikov 057973f4bb [FIR] Fix NPE on invalid gets with index
^KT-60342 fixed
2023-10-03 22:34:46 +00:00
Ivan Kochurkin 319fb967ec [FIR] Add TYPE_ARGUMENTS_FOR_OUTER_CLASS_WHEN_NESTED_REFERENCED diagnostics
Report TYPE_ARGUMENTS_FOR_OUTER_CLASS_WHEN_NESTED_REFERENCED instead of
WRONG_NUMBER_OF_TYPE_ARGUMENTS where it's appropriate

^KT-59393 Fixed

Simplify FirTypeResolverImpl
2023-10-03 19:49:56 +00:00
Ivan Kochurkin 8d27af5b0d [FIR] Fix reporting of TYPE_ARGUMENTS_NOT_ALLOWED instead of WRONG_NUMBER_OF_TYPE_ARGUMENTS 2023-10-03 19:49:56 +00:00
Ivan Kochurkin 42e5e43302 [FIR] Refactor FirTypeResolverImpl.resolveUserType
Fix IndexOutOfBoundsException on an attempt to cast an element

to inner class with type parameter

^KT-60921 Fixed
2023-10-03 19:49:56 +00:00
Ivan Kochurkin 5cd9afbf73 [FIR] Don't use @OptIn(LookupTagInternals::class) in DeclarationUtils 2023-10-03 19:49:56 +00:00
Svyatoslav Scherbina 8d82e7285d Bump Kotlin/Native version in KGP to 2.0.0-dev-4323 2023-10-03 17:49:16 +00:00
Dmitry Savvinov 23dbe5ed3e [mpp, tests] Minor: fix incorrect testdata
It was missed on rr/CI because those tests run only on macs, and
currrently CI has some troubles with that
2023-10-03 15:55:37 +00:00
Svyatoslav Scherbina 5be76eb57c Native: disable K2 for tests/samples/uikit
Currently it fails with K2 because of ^KT-62262
Disable K2 in this test in order to mute the failure.
2023-10-03 14:53:58 +00:00
Svyatoslav Scherbina 096edd8937 Native: enable K2 for benchmarksAnalyzer
benchmarksAnalyzer is built with bootstrap KGP and snapshot compiler.
Currently the former is K1, while the latter is K2. As a result, the
build fails because K2 compiler needs -Xfragment-sources argument,
while K1 uses -Xcommon-sources. So KGP passes the latter, while the
compiler expects the former.

Fix this by forcing KGP to use K2 for benchmarksAnalyzer.
2023-10-03 14:53:58 +00:00
Ilya Goncharov 68b55181fe [Gradle, JS] Fix muted JS gradle integration tests 2023-10-03 12:40:27 +00:00
Vsevolod Tolstopyatov f9d117cc9e Add Filipp Z. to CODEOWNERS Libraries Team
Add Seva and Simon to CODEOWNERS of the contribution guide

Merge-request: KT-MR-12336
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-10-03 12:37:46 +00:00
Sebastian Sellmair 750ae2c850 [Gradle][KMP] IdeJvmAndAndroidPlatformDependencyResolver: Do not filter ProjectDependencies
as this will result in losing transitive dependencies from said
project dependency.

KT-59020 is now fixed by detecting this case
before creating the 'IdeaKotlinUnresolvedBinaryDependency'

Caused by: KT-59020
^KT-62029 Verification Pending
2023-10-03 11:59:50 +00:00
Ilya Goncharov 7e52aa7b00 [Gradle, JS] Not depends on kotlin npm package 2023-10-03 10:40:21 +00:00
Alexander Udalov 41f736a665 IR: remove dependency of IrTypeSubstitutor on IrBuiltIns
It was only used in one place incorrectly anyway.
2023-10-03 10:18:54 +00:00
Alejandro Serrano Mena c2dfe415f3 [Test] Operator ambiguity check with 'set'
When using `x[y] += z` the spec mandates attempting all possible combinations.

^KT-62138 Fixed
2023-10-03 08:23:29 +00:00
Nataliya.Valtman 5b7b159d64 Fix unstable TryK2IT.smokeTestForNativeTasks test
fix test fails with unexpected task execution order for Linux
2023-10-03 07:05:34 +00:00
Mikhail Glukhikh 9cf1d36e5e K2: don't use outer class type parameters during nested class TP resolve
Before this commit, we allowed access to outer class type parameters
during resolve of type parameter bounds of a nested class.
In fact, outer type parameters are accessible in this situation
only if it's an inner class (or a local class).
This commit forbids such a usage. In the earlier fix of KT-57209
the same was done for regular type reference resolve.

#KT-61459 Fixed
#KT-61959 Fixed
2023-10-03 06:34:02 +00:00
Mikhail Glukhikh cdc197c723 K2: reproduce KT-61959 2023-10-03 06:34:01 +00:00
Mikhail Glukhikh 92470484bf K2: reproduce KT-61459 2023-10-03 06:34:01 +00:00
Alejandro Serrano Mena 310e89f100 [FIR] Report type-aliased 'Nothing' as return type
This warning was issued in K1, but lost in K2

^KT-59420 Fixed
^KT-59429 Fixed
2023-10-03 06:22:35 +00:00
Ilya Gulya f6b2c642c2 Support kotlinx.collections.immutable in kotlin-parcelize plugin
#KT-57685 Fixed

Co-authored-by: Ilya Gulya <ilyagulya@gmail.com>
2023-10-02 23:29:43 +00:00
Dmitriy Dolovov e8853fd40b [IR] Drop obsolete o.j.k.backend.common.serialization.signature.IdSignatureSerializer
It has been renamed to IdSignatureFactory. We have to keep
IdSignatureSerializer as a typealias for a while to keep the source
compatibility with the Compose compiler plugin.
2023-10-02 22:37:54 +00:00
Dmitrii Krasnov e63e4b17b7 [Gradle IT] Fixed regex for extracting task log on Windows
#KT-51553 Ready for Review
2023-10-02 20:28:55 +00:00
Alexander.Likhachev a2b688eb31 [Build] Preserve original jar with unshaded postfix in subplugin example
Otherwise we have two tasks writing output to the same file. That behavior confuses Gradle.
2023-10-02 18:02:47 +00:00