Commit Graph

105772 Commits

Author SHA1 Message Date
Anton Lakotka b154283149 [Gradle] Make sure that rootSoftwareComponent is always added
Even when createDefaultMultiplatformPublications=false and maven-publish
is applied it is required to create all publication-specific entities
such as tasks, configurations, components etc. In order to let users
to compose publications on their own.

^KT-62877 Verification Pending
2023-10-30 16:11:38 +00:00
Anton Lakotka d3f25d81de [Gradle] Change withPluginId to isPluginApplied
It is more convenient to use.
Also added test coverage for cases when plugin is applied too late.

^KT-62877 Verification Pending
2023-10-30 16:11:38 +00:00
Anton Lakotka 5607ae1bc3 [Gradle] Extract publicationDelegate as Project Stored Property
Previously it was attached to RootSoftwareComponent which has
heavy initialization work, for instance it creates new configurations
upon creation. The `publicationDelegate` is used in
`idOfRootModule` and should not trigger RootSoftwareComponent
initialization. After the change `idOfRootModule` became cross-project
safe. I.e. Project `foo` can call `idOfRootModule` on project `bar`.

^KT-62877 Verification Pending
^KTIJ-27374 Verification Pending
2023-10-30 16:11:38 +00:00
Anton Lakotka 6bb33cc8bc [Gradle] Test for Project's collection mutation after evaluation
Mutating projects data, particularly, adding new items to its
collections such as tasks, configurations and components is a potential
risk to lose these data during the import to IDE.

^KT-62877 In Progress
2023-10-30 16:11:38 +00:00
Sebastian Sellmair 36d1622276 [Gradle] Mute IdeNativeStdlibDependencyResolver in case of missing stdlib 2023-10-30 10:40:34 +00:00
Alexander Korepanov 0d7de87e2e [JS IR test] Add a test for invalidation with a src name chash 2023-10-30 09:14:16 +00:00
Alexander Korepanov ec71fe20e2 [JS IR] Fix file name clashes during JS BE invalidation 2023-10-30 09:14:16 +00:00
Alexander Korepanov 73bf7fa506 [JS IR test] Add a simple multiplatform invalidation test 2023-10-30 09:14:15 +00:00
Alexander Korepanov bf80d55fc3 [JS IR test] Use relative paths for klib building in invalidation tests 2023-10-30 09:14:15 +00:00
Alexander Korepanov 27b458c222 [JS IR test] Support multiplatform for invalidation tests 2023-10-30 09:14:15 +00:00
Evgeniy.Zhelenskiy 756cd25417 [FIR] Support typed projections in exposed visibility declaration checker
#KT-62925
2023-10-30 07:22:34 +00:00
Evgeniy.Zhelenskiy a836e6bf29 [FIR] Support flexible types and star projections in exposed visibility declaration checker
#KT-62925
2023-10-30 07:22:34 +00:00
Teng Zhang bf86afc867 KT-57870: Suppress InvalidPathException for paths with invalid characters when loading Konan library
^KT-57870 Fixed
2023-10-30 07:03:55 +00:00
Nikolay Lunyak d694c5d219 [FIR] Add references to the related K1 functions 2023-10-30 06:58:40 +00:00
Nikolay Lunyak cb4183bec6 [FIR] Remove enforcesEmptyIntersection
It's confusing + it's not really
correct. It checks properties of
LUB types rather than the original
ones, but if we want to replicate
K1, we should check the originals.
2023-10-30 06:58:40 +00:00
Nikolay Lunyak ed8935899c [FIR] Relax incompatibleEnumAndUnrelatedInterface 2023-10-30 06:58:40 +00:00
Nikolay Lunyak 8ec7d128f5 [FIR] Add one more missed case 2023-10-30 06:58:40 +00:00
Nikolay Lunyak 3fb7407ca1 [FIR] Make FirEqualityCompatibilityChecker a bit more readable 2023-10-30 06:58:40 +00:00
Nikolay Lunyak c6bec2fa75 [FIR] Relax incompatibleEnumAndUnrelatedInterfaceThroughTypeParameter 2023-10-30 06:58:40 +00:00
Nikolay Lunyak 3058f2eaff [FIR] Relax incompatibleEnumComparisonWithTypeParameters 2023-10-30 06:58:40 +00:00
Nikolay Lunyak ae521524d6 [FIR] Add tests highlighting false errors in K2 regarding equalities
Some overlooked corner-cases found by Denis.
2023-10-30 06:58:39 +00:00
Anastasia.Nekrasova 86e175bbf1 [K2] Disappeared KCLASS_WITH_NULLABLE_TYPE_PARAMETER_IN_SIGNATURE
^KT-59992
2023-10-30 06:42:00 +00:00
Ilya Chernikov 1d461684ae LT: make where clause with errors parsing same as with PSI
- do not fail on the missing terms
- propagate invalid name to avoid reporting dangling constraints

#KT-58455 fixed
2023-10-27 18:22:28 +00:00
Kirill Rakhman 87563f3aea [FIR] Rename diagnostic renderers that insert quotes and fix some messages
#KT-62386
2023-10-27 13:27:35 +00:00
Kirill Rakhman 2613a337ae [FIR] Improve symbol rendering in *_NOT_IMPLEMENTED diagnostics 2023-10-27 13:27:35 +00:00
Kirill Rakhman 44a4498ee5 [FIR] Report ABSTRACT_MEMBER_NOT_IMPLEMENTED_BY_ENUM_ENTRY on enum entries with initializer
#KT-59577 Fixed
2023-10-27 13:27:35 +00:00
Kirill Rakhman ef78d4b95a [FIR] Fix deserialization of generic context receivers
We need to pass the local deserialization context so that generic
type parameters can be referenced.

#KT-62607 Fixed
2023-10-27 11:35:22 +00:00
Dmitrii Krasnov 45a1cc1a4a [Gradle IT] Fixed prepareNativeBundleForGradleIT with k/n disabled
#KT-45978
2023-10-27 10:29:15 +00:00
Dmitriy Dolovov e18a2d0a2e [KLIB tool] Add tests for dumping metadata signatures 2023-10-27 09:28:00 +00:00
Dmitriy Dolovov 88a297b022 [KLIB tool] Run tests for 'dump-metadata' with & without signatures 2023-10-27 09:28:00 +00:00
Dmitriy Dolovov aa9b901926 [KLIB tool] Migrate 'dump-metadata' tests to K/N test infra 2023-10-27 09:28:00 +00:00
Dmitriy Dolovov 57e004e2b0 [KLIB tool] Respect '-signature-version' in 'dump-metadata' and 'dump-ir' commands 2023-10-27 09:28:00 +00:00
Dmitriy Dolovov c34e334550 [KLIB tool] Rename "signatures" to "dump-metadata-signatures"
To make KLIB tool command names more uniform.
2023-10-27 09:28:00 +00:00
Dmitriy Dolovov 8f141e5dc6 [KLIB tool] Minor. Update usage info 2023-10-27 09:28:00 +00:00
Dmitriy Dolovov 93506bcb95 [KLIB tool] Add tests for dumping IR signatures
^KT-62341
2023-10-27 09:27:59 +00:00
Dmitriy Dolovov a49723e35c [KLIB tool] Minor. Rename ir() to dumpIr() 2023-10-27 09:27:59 +00:00
Dmitriy Dolovov 02f52371c1 [KLIB tool] Rename "contents" to "dump-metadata"
To make KLIB tool command names more uniform.
2023-10-27 09:27:59 +00:00
Dmitriy Dolovov d8d95fdf4b [KLIB tool] Deprecate usage of KLIB repositories
^KT-61098
2023-10-27 09:27:59 +00:00
Dmitriy Dolovov 5961710db3 [KLIB tool] Don't print stack trace on trivial errors
1. Don't need to print stack trace on trivial errors such as invalid
CLI argument or incompatible library version.

2. Re-organization of `logWarning()` & `logError()` calls inside
the klib tool.
2023-10-27 09:27:59 +00:00
Dmitriy Dolovov 8ca62ad656 [KLIB tool] Fail with an adequate error message on IR-less KLIBs
^KT-62341
2023-10-27 09:27:59 +00:00
Dmitriy Dolovov f276fe6506 [KLIB] Add a reliable mechanism to check if KLIB has IR inside
^KT-62341
2023-10-27 09:27:59 +00:00
Dmitriy Dolovov 4b2776e126 [KLIB tool] Introduce new command: dump-ir-signatures
^KT-62341
2023-10-27 09:27:59 +00:00
Dmitriy Dolovov 447b0eddac [KLIB tool] Drop useless arg: -target 2023-10-27 09:27:59 +00:00
Dmitriy Dolovov b0c1cbff32 [KLIB tool] Minor. Reformat usage info 2023-10-27 09:27:59 +00:00
Bart van Helvert f31c93132e [AA] Fall back on fir building when getting type from reference
#KTIJ-26215 Fixed
2023-10-27 09:17:12 +00:00
Roman Golyshev ece43fe9c6 KT-62859 [LL FIR] Compute origin per declaration in StubBasedFirDeserializedSymbolProvider
Since `createStubBasedFirSymbolProviderForClassFiles` works for
builtins (after 866368cf), the provider sometimes has to handle
declarations from builtins (`Any?.toString()` or `arrayOf`, for example)

To provide correct origin for such declarations, we have to compute
the origin on the per-declaration basis instead of always setting
`Library` or `BuiltIn` origin

Providing correct origins should improve the consistency of
deserialized fir declarations

To reduce duplication, `getContainerSource` now also uses
`getDeclarationOriginFor`
2023-10-27 08:28:30 +00:00
Roman Golyshev 16608c8a1f KT-62859 [LL FIR] Introduce JvmStubDeserializedBuiltInsContainerSource
If deserialized declarations from built-ins have a container source
which implements `FacadeSource`, it might cause different problems
during IR compilation.

For example, IR lowering of `Any?.toString()` function call was broken
because IR assumed that this declaration belonged to a facade class
"kotlin.kotlin", which does not exist.

We introduce a special kind of container source for the built-ins
declarations, and there are in fact no real facade classes for such
declarations.

Also, `LLFirModuleWithDependenciesSymbolProvider` is modified to
correctly handle such sources. Previously it only handled
`FacadeSource`s, and now it knows about our special source for
built-ins.

^KT-62859 Fixed
2023-10-27 08:28:30 +00:00
Dmitrii Krasnov 1a9cd81a85 [KGP] Changed type of determining maturity version for k/n
#KT-62927 Fixed

Merge-request: KT-MR-12742
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-10-27 08:20:44 +00:00
Kirill Rakhman 8821f8d1a4 [FIR] Expand type alias when checking for type parameters from outer declaration
This fixes a false positive OUTER_CLASS_ARGUMENTS_REQUIRED when
referring to an inner class of a supertype that is extended using a
typealias.

#KT-62099 Fixed
2023-10-27 08:05:58 +00:00
Kirill Rakhman 907ebb36d0 [FIR] Filter out SAM constructors from MemberScopeTowerLevel
This tower level is for calls on a dispatch receiver, and it's not
allowed to call SAM constructors on a dispatch receiver.

#KT-60983 Fixed
2023-10-27 08:03:00 +00:00