Commit Graph

97719 Commits

Author SHA1 Message Date
Mikhail Glukhikh a13fd033fc Give slightly better names to language/API version variables in FP tests 2023-01-16 18:16:49 +01:00
Mikhail Glukhikh 70fc891260 K2: move -Xuse-k2 VS language version checks to CommonCompilerArguments 2023-01-16 18:16:49 +01:00
Mikhail Glukhikh 7a61578e08 Language version 2.0: fix compiler messages and minor details 2023-01-16 18:16:48 +01:00
Mikhail Glukhikh cbedbda527 Enhance API/messages around BinaryVersion / JvmMetadataVersion 2023-01-16 18:16:07 +01:00
Mikhail Glukhikh 13502abab9 Fix FIR bootstrap in version 2.0 2023-01-16 18:16:07 +01:00
Mikhail Glukhikh bbeae23b04 Allow to read metadata 2.0 from version 1.8 2023-01-16 18:16:07 +01:00
Mikhail Glukhikh 0c4a0360ac Deserialization/class reading: pass chosen JvmMetadataVersion whenever possible 2023-01-16 18:16:07 +01:00
Mikhail Glukhikh 52ab565cc6 Move LANGUAGE_TO_METADATA_VERSION to compiler:frontend.common.jvm 2023-01-16 18:14:52 +01:00
Mikhail Glukhikh 89dd28226b BinaryVersion: introduce isCompatibleWithCurrentCompilerVersion 2023-01-16 18:12:55 +01:00
Mikhail Glukhikh f6b8b3438a Extract & use GenerationState.metadataVersion helper 2023-01-16 18:12:55 +01:00
Mikhail Glukhikh f332b6dcec Handle LV 2.0 in modularized tests 2023-01-16 18:12:55 +01:00
Mikhail Glukhikh 17c434002a Move EnableDfaWarningsInK2 into experimental section until K2/IDE EAP
This commit means that we will not see K2 DFA warnings until
we explicitly enable them (probably in 1.9.20 or 2.0).
We are going to enable DFA warnings at the moment when
K2/IDE is accessible for external users
2023-01-16 18:12:55 +01:00
Mikhail Glukhikh 3dc05f4ec5 Introduce language version 2.0 and associate K2 compiler with it 2023-01-16 18:12:55 +01:00
Mikhail Glukhikh afe1150aec KotlinClassInfo: commit back an accidentally reverted fix of KTIJ-20954 2023-01-16 18:12:55 +01:00
Marco Pennekamp 88ac5727cc [LL FIR] KT-50732 Add support for LL FIR-specific tests (.ll.kt)
- `.ll.kt` test data can be added in cases where LL FIR resolution
  legally diverges from K2 compiler results.
- Each `.ll.kt` test is prefixed with an `LL_FIR_DIVERGENCE` directive
  which must explain why the test may diverge from K2 compiler results.
  - `LLFirDivergenceCommentChecker` ensures that each `.ll.kt` file
    contains an `LL_FIR_DIVERGENCE` directive.
- `LLFirIdenticalChecker` results in an assertion error if the `.ll.kt`
  test and its base test are completely identical, including in their
  meta info (but ignoring `LL_FIR_DIVERGENCE`).
  - The checker additionally ensures that the base source file and the
    `.ll.kt` source file have identical Kotlin source code (ignoring
    meta info and `LL_FIR_DIVERGENCE`). This ensures that both tests
    test the exact same thing.
- `.ll.kt` files are ignored by select test generators, in addition to
  `.fir.kt` files.
2023-01-16 15:20:50 +00:00
Marco Pennekamp b0db0f59b4 [LL FIR] KT-50732 Remove FIR_IDE_IGNORE from K1 spec tests
- `FIR_IDE_IGNORE` was already removed from the `.fir.kt` counterparts,
  but removing the directive from the `.kt` files had been forgotten.
2023-01-16 15:20:50 +00:00
Sebastian Sellmair d0bb804e85 [Gradle] kgp-idea-proto: Add public API for extras serialisation
KT-55926
2023-01-16 14:56:46 +00:00
Sebastian Sellmair 54db04e0f4 [Gradle] ExternalTargetApiExtensions: Add extension for KotlinCompilation.extras
KT-55926
2023-01-16 14:56:46 +00:00
Sebastian Sellmair 16835469a4 [Gradle] Let InternalKotlinTarget implement HasMutableExtras
KT-55926
2023-01-16 14:56:45 +00:00
Dmitrii Gridin 3eabb3038d [SLC] SymbolLightMethod: drop accidentally added isOverride 2023-01-16 15:36:14 +01:00
Alexander.Likhachev 75c9fd3032 [Gradle, MPP] Suppress deprecation warnings for tests with an old AGP
#KT-52998 In Progress
2023-01-16 13:42:57 +00:00
Sergey Bogolepov 8120025076 [K/N] Add a test for KT-55653 2023-01-16 13:26:09 +00:00
Sergey Bogolepov c3a250e57a [K/N] Fix KT-55653 2023-01-16 13:26:09 +00:00
Sergey Bogolepov 3ade4fbedc [K/N] Add backend.native test for objcClassesIncludingCategories 2023-01-16 13:26:08 +00:00
Sergey Bogolepov 4ffb43c5bd [K/N] Cover objcClassesIncludingCategories with smoke tests 2023-01-16 13:26:08 +00:00
Sergey Bogolepov a9d13338bd [K/N] Make AbstractNativeCInteropTest a bit more flexible
It probably requires a bit more thoughful refactoring, but before that
we need to collect more test-cases.
2023-01-16 13:26:07 +00:00
Sergey Bogolepov 72637f19dc [K/N][cinterop] Generate members of included categories as class members
This way inheritors of such class would be able to override category
members the same way they can in Objective-C. Also, API surface of
interop libraries should become a little more stable.
2023-01-16 13:26:07 +00:00
Sergey Bogolepov 898dd02d29 [K/N][cinterop] Indexer unit-tests of objcClassesIncludingCategories 2023-01-16 13:26:07 +00:00
Sergey Bogolepov eded880225 [K/N][cinterop] Add location to ObjCCategory
To avoid adding unnecessary included categories to index, we need
to track their location. Also, we can't just implement TypeDeclaration
interface because category is not a type. Thus, we extract `location`
property from TypeDeclaration to LocatableDeclaration and implement it
in ObjCCategory.
2023-01-16 13:26:06 +00:00
Sergey Bogolepov fe8e18cb33 [K/N][cinterop] Improve Imports interface
Extracting `isImported(headerId: HeaderId): Boolean` method allows
mocking this interface in tests
2023-01-16 13:26:06 +00:00
Sergey Bogolepov 2f0bdfc5e2 [K/N] Add objcClassesIncludingCategories cinterop property
It allows to list Objective-C classes that should include
corresponding categories from the same file.
The current implementation is super-simple and slow, but
it is OK since it is not intended to be a general-purpose
solution for now.
2023-01-16 13:26:05 +00:00
Alexander.Likhachev ab205edeab [Gradle] Fix MppCompositeBuildIT.test - sample1 - ide dependencies
The test was trying to invoke a task from the root project prepending it with two colons, which became an error since 7.6
#KT-53811 In Progress
2023-01-16 11:43:24 +00:00
Alexander.Likhachev 46e45b8137 [Gradle] Simplify regexp for extracting task output in integration tests
Gradle has slightly changed logging since 7.6, so the old way stopped working
#KT-53811 In Progress
2023-01-16 11:43:24 +00:00
Alexander.Likhachev 4b1c7f1c11 Bump max Gradle version to 7.6 in integration tests 2023-01-16 11:43:24 +00:00
Abduqodiri Qurbonzoda ba2833b90f Mark Base64 API with ExperimentalEncodingApi 2023-01-16 11:24:50 +00:00
Abduqodiri Qurbonzoda 954ec1f63c Introduce @ExperimentalEncodingApi for binary-to-text encoding API 2023-01-16 11:24:50 +00:00
Abduqodiri Qurbonzoda dc03a03762 Introduce basic, url-safe and mime Base64 variants #KT-9823 2023-01-16 11:24:49 +00:00
Alexander Korepanov a5c8e30bb1 [JS IR] Use a copy of an original inline function for inlining
If inline function A calls another inline function B,
 we must use the original version of inline function A for inlining,
 which doesn’t have inlined function B. Because during the inlining
 process, we remap all occurrences of inline function A
 to a temporary copy of function A, and if the function B
 somehow uses function A (e.g. callable reference),
 the built IR will have a reference to the temporary function,
 not the original one. All these things lead to broken cross-module references.

 This patch saves the original versions of all inline functions
 before inlining and provides them during the inline process.

^KT-55930 Fixed
2023-01-16 11:01:03 +00:00
Artem Vasilev 82d934d873 [LL FIR] fix typo in LLFirModuleData.friendDependencies
^KTIJ-23347 Fixed
2023-01-16 10:48:38 +00:00
Pavel Kunyavskiy 6ab00a65dd [K/N] Support volatile intrinsics on globals
Also, make intrinsics signature more consistent with other intrinsics,
e.g. with isInitialized on lateinit field.

^KT-54944
2023-01-16 08:34:24 +00:00
Pavel Kunyavskiy 49d286e4e8 [K/N] Wrap volatile boolean to byte
^KT-54944
2023-01-16 08:34:23 +00:00
Pavel Kunyavskiy fc95b88eef [K/N] Tests for volatile
^KT-54944
2023-01-16 08:34:23 +00:00
Pavel Kunyavskiy a11f6fd9cb [K/N] Support of aligned fields
For now only alignment by at most 8 is supported for instance fields.

^KT-54944
2023-01-16 08:34:21 +00:00
Pavel Kunyavskiy 6da66649e7 [K/N] Hack for make 64-bit atomics working on mips
^KT-54944
2023-01-16 08:34:21 +00:00
Pavel Kunyavskiy 9dea349752 [K/N] Support of @Volatile annotation
^KT-54944
2023-01-16 08:34:20 +00:00
Ilya Chernikov a29c418b63 Add missing platform core hack to use nio2, avoids warning on Windows
add the hack to project environment creation, instead of compliation
call sites, covers missing scenarions with maven scripting and K@ now
and should help to avoid problems in the future.
#KT-54461 fixed
2023-01-15 20:11:57 +01:00
Ilya Chernikov ea255135a4 Scripting: avoid CME in maven resolving in IDE scenarios
combination of laziness in AetherResolveSession and possibly
async-modifiable repos collection in MavenDependenciesResolver
may lead to the CME.
#KT-54733 fixed
2023-01-15 20:11:56 +01:00
Ilya Chernikov 6c035bb5f4 Scripting: support scripts starting with UTF-8 BOM
#KT-54705 fixed
2023-01-15 20:11:56 +01:00
Ilya Chernikov 989c1ec64d Scripting: allow slf4j relocation
#KT-53283 fixed
2023-01-15 20:11:56 +01:00
Ilya Chernikov 80c80ad4e0 Scripting: replace slf4j-nop binding with -simple one in main-kts
will allow to see aether loging in case of resolving problems and may
simplify some problems similar to #KT-54819
2023-01-15 20:11:56 +01:00