Commit Graph

98714 Commits

Author SHA1 Message Date
Igor Chevdar 0655b02097 [IR] Proper error message for IR validation 2023-02-14 07:30:46 +00:00
Igor Chevdar 1e8cd91e0f [IR] Fixed wrong IrCall type (to fix IR validation) 2023-02-14 07:30:45 +00:00
Igor Chevdar 18e213426c [IR] Fixed wrong IrConst type (to fix IR validation) 2023-02-14 07:30:45 +00:00
Igor Chevdar 3dad0cfb05 [IR] Fixed wrong IrCall type (to fix IR validation) 2023-02-14 07:30:45 +00:00
Igor Chevdar 5e6aa649ed [IR] Extracted implicitCastIfNeeded to common utils 2023-02-14 07:30:44 +00:00
Igor Chevdar 750bb5c8c4 [K/N][IR] Added proper parent 2023-02-14 07:30:44 +00:00
Igor Chevdar ea2ce2b52e [IR] Fixed wrong parents 2023-02-14 07:30:44 +00:00
Denis.Zharkov 427b221eaf K2: Get rid of redundant parameter of ConeCallConflictResolver methods
discriminateGenerics was only set to false in recursive calls of
ConeOverloadConflictResolver
2023-02-14 07:14:10 +00:00
Ilya Gorbunov 61e9f98b9f Load JDK 8 platform implementations class without reflection
Also remove search for other platform implementation classes because
now the first match should be found in the same jar

Helps to avoid GraalVM related reflection problems in KT-51579
2023-02-13 20:25:30 +00:00
Yunir Salimzyanov 3cb0d489bf KT-55700: fix kotlin-test-sources.jar in compiler lib
to contain both jvm and common parts
as it is made for maven artifacts distribution
2023-02-13 17:42:27 +00:00
Dmitrii Gridin 607b8f6b61 Revert "[SLC] Support generics and ignore whitespace in KtSuperTypeList.findEntry"
This reverts commit e77f5c7764.
2023-02-13 17:28:35 +01:00
Dmitrii Gridin 761553ea75 [LC] reduce memory consumption from SLC and DLC
The main change is drop `LightClassesLazyCreator`

KtLightClassForDecompiledDeclaration:
* fixed a few captured fields

^KT-56561 Fixed
2023-02-13 16:08:17 +00:00
Dmitrii Gridin a8e8fc1f11 [LC] add ClassInnerStuffCache
^KT-56561
2023-02-13 16:08:16 +00:00
Dmitrii Gridin f501259cd4 [ULC] KtLightClassBase: do not override myInnersCache
^KT-56561
2023-02-13 16:08:16 +00:00
Konstantin Tskhovrebov aae0cf9e30 Restore a Kotlin facet version to keep serialized settings compatibility
And add a fallback for ExternalSystemTestRunTask serialization.
2023-02-13 16:07:56 +00:00
Pavel Mikhailovskii e77f5c7764 [SLC] Support generics and ignore whitespace in KtSuperTypeList.findEntry 2023-02-13 14:47:45 +00:00
Pavel Punegov a9cae3fe87 [K/N][build] Cleanup obsolete build tasks
* Remove obsolete reporting
* Remove old build tasks: BuildPusher and CollisionDetector
* Gradle build file cleanup
* Remove old wrappers

Merge-request: KT-MR-8788
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-02-13 14:02:28 +00:00
Svyatoslav Kuzmich 26c1098a4f [Wasm] Fix inliner issues (KT-56584)
* Fix objects in inline functions and lambdas:
  * Add common lowerings used in K/JS and K/Native
* Fix inline lambda call detection logic in presence of additional casts


Merge-request: KT-MR-8791
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-02-13 13:14:43 +00:00
Yahor Berdnikau 1b5210b870 Exclude generated Kotlin-DSL from copyrights test
This DSL is generated by Gradle and not end up in published artifacts.
2023-02-13 12:58:32 +00:00
Yahor Berdnikau db9c440e90 Drop leftovers usages 'forUseAtConfigurationTime' 2023-02-13 12:58:32 +00:00
Yahor Berdnikau 7819e2bf54 Add settings convention for JVM toolchain provider 2023-02-13 12:58:31 +00:00
Yahor Berdnikau 30d218827a Align Gradle enterprise version in KGP 2023-02-13 12:58:31 +00:00
Yahor Berdnikau 920f76b9ef Add settings convention for Gradle enterprise 2023-02-13 12:58:30 +00:00
Yahor Berdnikau b7f50aeaf2 Introduce repo settings conventions
First convention is to configure Gradle build cache.
2023-02-13 12:58:30 +00:00
Mikhail Glukhikh 2405f28e64 K2: add test confirming successful work of KT-56261 2023-02-13 12:21:42 +00:00
Kirill Rakhman 314784f435 [FIR] Introduce FirDeclarationStatus.hasStableParameterNames
This flag is true by default but is set to false for

- Java methods and constructors
- interface delegation methods that delegate to Java

The NAMED_ARGUMENTS_NOT_ALLOWED logic is mostly refactored to use the
new flag though some custom logic remains for determining the correct
message and to work around a corner case with fake overrides.

The flag is (de)serialized from/to metadata. For backward compatibility
with K1, delegated methods to Java types are deserialized as stable.

^KT-40480 Fixed
2023-02-13 12:09:39 +00:00
Kirill Rakhman 152e63b198 [FIR] Remove redundant setting of DeclarationStatus properties 2023-02-13 12:09:39 +00:00
Kirill Rakhman d204d65174 [FIR] Reformat FirElementSerializer 2023-02-13 12:09:39 +00:00
Marco Pennekamp fb43e53ca3 [LL FIR] KTIJ-24574 Fix containing declaration finder for init blocks
- KTIJ-24574 occurred because a local destructuring declaration was
  erroneously returned as the non-local containing declaration of an
  element by `getNonLocalContainingOrThisDeclaration`. This occurred in
  `init` blocks.

KTIJ-24574 fixed
2023-02-13 10:38:26 +00:00
Ilya Kirillov 769fb835f9 [Analysis API] introduce a KotlinResolutionScopeProvider to optimize the resolutions scope in the IDE 2023-02-13 11:35:24 +01:00
Konstantin Tskhovrebov bb0ddcbeba Add kotlin platform ID to imported gradle run tasks
It is necessary to determine a platform for the run tasks, for example, to hide run configurations for a some specific target.
2023-02-13 10:20:41 +00:00
Svyatoslav Scherbina f78ffcb300 [K2/N] Unignore three tests fixed by basic forward declarations support
These tests got fixed by b19058c.

^KT-56028
2023-02-13 10:01:12 +00:00
Svyatoslav Scherbina 1c5335302d [K2/N] Unignore mistakenly ignored testValuesGenericsFramework 2023-02-13 10:01:12 +00:00
Ilya Kirillov 1f834aa99c [Analysis API FIR] avoid redundant resolve in renderer
Before we resolved all declarations to body resolve.
It was rarely needed and badly affects performance.
If the resolution will still be needed, it will be lazily performed by KtSymbol
2023-02-13 09:53:33 +00:00
Dmitrii Gridin 06095b379f [LL API] LLFirProvider: add missing usage of SyntheticFirClassProvider for callable declarations
currently on air resolve failed for such declarations
^KT-55750
2023-02-13 07:37:31 +00:00
Vladimir Sukharev 93baad5f39 Add KotlinTestK2LibraryTest to new test infra
Merge-request: KT-MR-8766
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-11 13:58:08 +00:00
Svyatoslav Scherbina b19058caef K2/Native: support cinterop forward declarations
Support importing synthetic declarations from "magic" forward
declaration packages:
- cnames.structs
- objcnames.classes
- objcnames.protocols

So this is a rough equivalent to the forward declarations module
made of ForwardDeclarationsPackageFragmentDescriptor in K1.

Unlike K1 implementation, this K2 one doesn't allow importing
a declaration that wasn't actually forward-declared in a C/Objective-C
header available through a cinterop klib dependency.
2023-02-10 20:17:05 +00:00
Sebastian Sellmair 1936efed11 [MPP] NativeDistributionCommonizerLock: Support classpath isolation
^KT-56510 Verification Pending
2023-02-10 18:55:28 +00:00
Sebastian Sellmair ec67131d82 [MPP] Implement NativeDistributionCommonizerLockTest for isolated class loaders
KT-56510
2023-02-10 18:55:28 +00:00
Vladimir Sukharev 7bce6d21f0 Disable in K2 tests that fail for two-stage
Merge-request: KT-MR-8786
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-10 16:59:25 +00:00
Nikolay Lunyak a9343aeb7d [FIR] KT-55840: Ensure everything actually works
This inconsistency is present due to not using the `// WITH_STDLIB`
in the above tests. When K1 creates the enum, it tries to generate
`entries()`, and for that it tries to load `kotlin.enums.EnumEntries`,
but this is actually an unresolved reference. K1 silently swallows it,
and proceeds.

The reason K2 doesn't fail is that in order to generate `entries()` it
simply creates the necessary `ConeClassLikeType` with the desired
`classId` instead of loading the whole `ClassDescriptor`.

The reason we can still observe `$ENTRIES` and `$entries` in K1
is because they are generated during the JVM codegen, and it
only checks if the `EnumEntries` language feature is supported. It
doesn't check if the `entries` property has really existed in IR
(by this time it's expected to have already been lowered to the
`get-entries` function - that's why "has ... existed").

The reason why the codegen doesn't fail when working with
`kotlin.enums.EnumEntries` is because it creates its
own `IrClassSymbol`.

^KT-55840 Fixed

Merge-request: KT-MR-8727
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-02-10 16:57:51 +00:00
Stanislav Erokhin 57eae167cc Restore FunctionClassKind for compatibility with Android IDEA plugin 2023-02-10 16:01:05 +00:00
Stanislav Erokhin bec9ad0f6b Minor. Rename FunctionClassDescriptor#functionKind -> functionTypeKind
This commit is needed for the following commit.
There we will restore the compatibility API with Android IDEA plugin
2023-02-10 16:01:04 +00:00
Igor Chevdar a14f3c8cc2 [K/N] Fixed wrong initializer call extraction for interop-visible functions
#KT-56521 Fixed
2023-02-10 15:45:11 +00:00
Igor Chevdar 2281d9700d [K/N] Added a test for #KT-56521 2023-02-10 15:45:10 +00:00
Anna Kozlova a71a94add7 [LL] avoid dbl service registration 2023-02-10 13:20:02 +00:00
Pavel Kunyavskiy c400a75407 [K/N] Fix tests failing because of phase renaming 2023-02-10 12:58:22 +00:00
Dmitriy Novozhilov f3fd4b3e01 [FIR] Add stack of all FIR elements to CheckerContext
^KT-56472 Fixed
2023-02-10 12:30:14 +00:00
Dmitriy Novozhilov 41192b022d [FIR] Pass context to all relevant methods of FirDeclarationGenerationExtension
^KT-53470 Fixed
2023-02-10 12:30:14 +00:00
Dmitriy Novozhilov ea73cde5fb [Lombok] Make visibility of fields of @Value classes private by default (K2)
^KT-51092 Fixed
2023-02-10 12:30:13 +00:00