Commit Graph

102509 Commits

Author SHA1 Message Date
Artem Kobzar 7c7aa98875 [K/JS] Throw error when a module contains file with the same name and package (ignoring case) 2023-07-07 13:50:04 +00:00
Anton Prokhorov 0e6930e7ef [Gradle] Getting a root project of root gradle after project loading
#KT-59863 Fixed
2023-07-07 13:43:43 +00:00
Yan Zhulanow e5f9eb5b24 [LL API] Fix 'getResolvableSessionFor()' for library sessions 2023-07-07 13:34:01 +00:00
Bart van Helvert 362675a1b5 [AA] Support getting type from get and set annotation calls
#KTIJ-26206 Fixed
2023-07-07 12:57:45 +00:00
Andrei Klunnyi c9eebffbfa KT-60193 K2 scripts: configuration discovery might fail silently
Due to possible data races configuration discovery might fail. So far,
it happened silently and we used so-called default one. This
configuration is unaware of specific implicit imports, receivers, base
class, etc. Hence, broken highlighting and navigation.

This commit introduces the following changes:
1. Having default configuration for building `FirScript` is no longer an
   option. Missing configuration means error reported via exception.
2. Every configuration usage is now logged in DEBUG mode.
   Troubleshooting becomes easier.

^KT-60193 fixed
2023-07-07 14:50:35 +02:00
Dmitrii Gridin 6867dffff1 [LL FIR] rewrite on-air resolve
Now we will resolve declarations only ones and to the
minimal required phase to get a fully resolved element
depends on an insert position, because not all elements
require body resolution

A side change: `getOnAirGetTowerContextProvider` now
won't do rebind to the original declaration. In the future,
this part will be rewritten to avoid on-air resolution,
so it is not a problem

^KT-59685 Fixed
2023-07-07 11:42:22 +00:00
Brian Norman 61acd2b6f5 [FIR] Do not allow context receivers on value classes
#KT-59413 Fixed
2023-07-07 11:41:59 +00:00
Brian Norman b74ff19930 [FIR] Improve synthetic function condition in annotation class checker 2023-07-07 11:41:59 +00:00
Dmitriy Novozhilov e7a10057f2 [Test] Use special test facade for IR actualization and IR plugins in all codegen configurations
Previously application of plugins was part of fir2ir conversion and
  ir actualization was the responsibility of each specific IR backend
  facade. Now (after moving IR extensions after IR actualization) those
  actions are extracted into separate facade for two purposes:
1. Avoid code duplication in backend facades
2. Step with this facade goes exactly after fir2ir conversion before
   irHandlersStep, which allows IR handlers to observe IR which was
   actualized and modified by extensions, which is quite useful

^KT-56173
2023-07-07 11:26:15 +00:00
Dmitriy Novozhilov fd87d722c1 [FIR2IR] Make ExternalPackageParentPatcher a lowering
This is needed for two reasons:
1. Consistency
2. It should run after compiler plugins, which are now runs after fir2ir
   is finished for all modules

^KT-56173
2023-07-07 11:26:15 +00:00
Dmitriy Novozhilov 8e73d5a54a [FIR] Run irGenerationExtensions after IR actualization
^KT-56173 Fixed
2023-07-07 11:26:15 +00:00
Dmitriy Novozhilov 81da96fed3 [FIR Plugin] Reproduce KT-56173 2023-07-07 11:26:15 +00:00
Pavel Mikhailovskii 083f54aceb [KAPT4] Create basic infrastructure for KAPT4 2023-07-07 11:09:16 +00:00
Dmitriy Novozhilov fc57f48c8f [FIR] Union CFG edges from postponed lambdas only if outer call was analyzed independently
Before this change nodes unification was called if outer call was
  completed in the FULL mode, but it may happen even if this call is
  actually a part of some other outer call
2023-07-07 06:45:20 +00:00
Artem Kobzar cf949e8760 [K/JS] Support KClass<*>.createInstance reflection method ^KT-58684 Fixed 2023-07-06 18:18:14 +00:00
Mikhail Glukhikh ca0b061675 Add forgotten issue reference for PrioritizedEnumEntries 2023-07-06 17:49:15 +00:00
Mikhail Glukhikh ff490fb633 FIR2IR: add more detailed exception message for KT-59766 2023-07-06 17:49:15 +00:00
Pavel Punegov e722212502 [K/N][test] Suppress internal visibility in the test with @Retain 2023-07-06 16:22:02 +00:00
Mikhail Glukhikh 15b070b494 K2: don't resolve callable reference to enum entries #KT-59611 Fixed 2023-07-06 15:06:31 +00:00
Artem Daugel-Dauge 9bbfdb708c [Gradle] Log reason why podInstall task is skipped
^KT-60050 Verification Pending
2023-07-06 14:57:40 +00:00
Alexander Korepanov 2cb28b6be1 [JS IR] Add an explicit toString() call for concatenating Char values
^KT-59718 Fixed
2023-07-06 14:40:06 +00:00
Artem Daugel-Dauge b381752074 [Gradle] Fix cocoapods' cinterops UTD
^KT-60112 Verification Pending
2023-07-06 13:53:52 +00:00
Anton Lakotka 344dbcbd23 [Gradle] Update apiDump after removing relatedConfigurationNames
^KT-58225 Verification Pending
2023-07-06 13:23:16 +00:00
Anton Lakotka a171d0d88e [Gradle] Fix PomDependenciesRewriter to check Android-specific configurations
Initially it was implemented via "relatedConfigurations", but these
relatedConfigurations didn't contain outgoing configurations for default
base compilations, but for KotlinJvmAndroid did. There is no reason to
check incoming configurations for dependency rewriter. So for
KotlinJvmAndroidCompilation it is enough to check their variant-specific
outgoing configurations.

^KT-58225 Verification Pending
2023-07-06 13:23:16 +00:00
Anton Lakotka a5250839fa [Gradle] Include users attributes to host-specific metadata configuration
^KT-60134 Verification Pending
2023-07-06 13:23:16 +00:00
Anton Lakotka 24ff1c6285 [Gradle] Fix test compilation after removing relatedConfigurations
^KT-58225 Verification Pending
2023-07-06 13:23:16 +00:00
Anton Lakotka eb238c0da7 [Gradle] Remove maybeRegister in favor of getOrCreate
It had a little use and even this use was causing a problem. Since
inside `maybeRegister {  }` this block Gradle forbids creation of
other entities. Because this block is part of "entity configuration".

So it is recommended to replace with either
* `getOrCreate("foo", invokeWhenCreated = {})`
* or just getOrCreate("foo").apply {}
2023-07-06 13:23:16 +00:00
Anton Lakotka 001bdc411d [Gradle] Remove relatedConfigurationNames
It was public api which has not much use outside KGP.
Moreover, this api has a little use so it is ok list configuration names
in place.

^KT-58225 Verification Pending
2023-07-06 13:23:16 +00:00
Dmitriy Dolovov 8aacdb471b [K/N] Fix: Ignore bridge functions in FunctionReferenceLowering
^KT-59858
2023-07-06 12:39:46 +00:00
Leonid Startsev f3833fdcf8 Add serializer(vararg KSerializer<*>) override from SerializerFactory when necessary
SerializerFactory is an implementation detail for Kotlin/JS and Native:
it should be added as a supertype to a companion object of certain serializable classes
and `serializer(vararg KSerializer<*>)` function from it should be implemented.
Existing implementation added the supertype, but did not add proper override to FirClass
of a companion, which led to various warnings and errors like 'Abstract function 'serializer' is not implemented in non-abstract companion object'.

Also implemented the addition of SerializerFactory supertype to user-defined companions within @Serializable and @MetaSerializable when necessary.

Also set up proper box tests for FIR+Kotlin/JS combination.

#KT-58501 Fixed
#KT-59768 Fixed
2023-07-06 11:38:51 +00:00
Yahor Berdnikau 351e9c7592 [repo] Update Dokka to 1.8.20 version
This release also fixes some problems with KGP-api documentation
publication.
2023-07-06 11:07:48 +00:00
Dmitriy Novozhilov 037572ee9f [FIR] Create FirExtensionSyntheticFunctionInterfaceProvider only once for all sessions
This is needed to avoid duplication of symbols for the same classIds

^KT-58539 Fixed
2023-07-06 11:00:38 +00:00
Dmitriy Novozhilov 32891edc3e [Test] Register DisableLazyResolveChecksAfterAnalysisChecker as first failures suppressor
It's important to filter out failures from lazy resolve before calling other
  suppressors like BlackBoxCodegenSuppressor. Otherwise other suppressors
  can filter out every failure from test and keep it as ignored even if
  the only problem in lazy resolve contracts, which disables with special directive
2023-07-06 11:00:38 +00:00
Dmitriy Novozhilov d46f697cf8 [Test] Reproduce KT-58539 2023-07-06 11:00:38 +00:00
Dmitriy Novozhilov 1212128f04 [FIR plugin] Replace composable functions with regular kotlin functions 2023-07-06 11:00:38 +00:00
Ivan Kylchik 31e75cc603 [JS_IR] Forbid to inline constants during const lowering 2023-07-06 11:00:14 +00:00
Ivan Kylchik d3d28783c5 [IR] Support const optimizations for JS backend 2023-07-06 11:00:14 +00:00
Ivan Kylchik abbafc0b2a [IR] Move some inline utils from backend.common into ir.util 2023-07-06 11:00:14 +00:00
Sergei Kharitontcev-Beglov 55bfd3efcb KT-52178: Argument propagation into IR backend & lowering dump action 2023-07-06 10:55:26 +00:00
Timofey Solonin 5026778cd1 [MPP] Inject CInteropCommonizerTask from outside instead of using a
future

^KT-58712
2023-07-06 10:20:04 +00:00
Ilya Goncharov 9ef5ce2af4 [JS] Migrate JsVersionRequirementTest 2023-07-06 08:08:56 +00:00
Ilya Goncharov 3bdb8b6d11 [JS] Migrate multiplatform integration compiler test 2023-07-06 08:08:55 +00:00
Ilya Goncharov a6d461dbe8 [JS] Fix compile kotlin against custom binaries 2023-07-06 08:08:55 +00:00
Ilya Goncharov b6803b2400 [JS] Migrate web demo examples 2023-07-06 08:08:55 +00:00
Ilya Goncharov b5a7b9c661 [JS] Migrate multi module order test 2023-07-06 08:08:55 +00:00
Ilya Goncharov 08c04af5b5 [JS] Remove legacy line numbers test 2023-07-06 08:08:55 +00:00
Yahor Berdnikau 82fa02f71e [Gradle] Remove unused resources in Gradle integration tests 2023-07-06 07:39:18 +00:00
Yan Zhulanow 8f798119cc [FIR] Build raw FIR for code fragments 2023-07-06 15:58:30 +09:00
Yan Zhulanow b7921a401b [FIR] Make 'resolveIfJavaType()' accessible from LL API
This is needed for providing types for '_DebugLabel' variables in
code fragments. Originally, there come a JVM type descriptor, so there
it's converted to a FirResolvedTypeRef reference through FirJavaTypeRef.
2023-07-06 15:58:30 +09:00
Yan Zhulanow 8ffb329741 [FIR] Add 'buildCodeFragmentCopy()' and 'replaceBlock()' for IDE analysis 2023-07-06 15:58:30 +09:00