Commit Graph

105777 Commits

Author SHA1 Message Date
Ilya Kirillov 1aa5cf031f [Analysis API FIR] fix "ConeClassLikeTypeImpl is not resolved to symbol for on-error type"
We should not expect builtins to be always available as they are taken from indecies.

For K1 and FIR Standalone implementations, the builtins are always available.

^KT-62010 fixed
2023-10-31 12:24:16 +00:00
Nikolay Lunyak f5d859f209 [FIR] Don't miss smartcast info on equalities with when subjects
Since they are not `FirSmartCastExpression`s,
they are treated as proper original types,
thus leading to reporting errors instead of
warnings.

^KT-60095 Fixed
2023-10-31 10:40:43 +00:00
Alexander Udalov 4f96171716 K2: report IR_WITH_UNSTABLE_ABI_COMPILED_CLASS
Also, remove setting the value of allowUnstableDependencies to true if
K2 is used because we want K2 to report errors (as K1 does) on
unstable-ABI dependencies.

 #KT-61598 Fixed
2023-10-31 10:39:43 +00:00
Alexander Udalov 6a1c210cd1 Minor, remove obsolete mention of issue in previously muted test
The test was fixed for K2 in 365ce2a6a5.
2023-10-31 10:39:43 +00:00
Brian Norman 01a757cbd6 [FIR] Report PROPERTY_WITH_NO_TYPE_NO_INITIALIZER for all properties
Currently, PROPERTY_WITH_NO_TYPE_NO_INITIALIZER is reported for local
variables, but not reported for member or top-level properties. Add a
check to the common `checkPropertyInitializer` for when a property
type cannot be determined from the getter.

This also corrects a K1 versus K2 inconsistency, where K2 would allow
blocks from getters to determine property type instead of only allowing
expression bodies.

^KT-59935 Fixed
^KT-60117 Fixed
^KT-60123 Fixed
2023-10-30 16:28:10 +00:00
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