Commit Graph

102526 Commits

Author SHA1 Message Date
Nikolay Lunyak 24b1fb2ccf [FIR] Create tickets for some of the TODOs 2023-07-10 09:28:54 +00:00
Pavel Kunyavskiy ef9413108b [K/N] Consolidate forward declarations handling
This is refactoring in preparation for KT-59764.
Names and layout of forward declarations related classes
was copy-pasted many times over compiler code.

Implementing KT-59764 would require copy-pasting it two more times.
So instead of doing this it was put in single place.

No behaviour changes intended in this commit.
2023-07-10 08:59:16 +00:00
Pavel Kunyavskiy 0179b45840 Introduce compiler.common.native module 2023-07-10 08:59:16 +00:00
Vladimir Dolzhenko c1b70a7303 Move under debug log message when nested class is not found
To avoid freezes and useless reporting calculations

#KTIJ-25465 Fixed


Merge-request: KT-MR-10996
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-07-08 07:18:09 +00:00
Igor Yakovlev b5eafb9eb7 [Wasm] WasmExport implementation 2023-07-07 20:45:51 +00:00
Igor Chevdar 58639951f6 [K/N] Refactored 2-stage splitting 2023-07-07 17:51:46 +00:00
Igor Chevdar afdc596121 [K/N] Fix for two-stage compilation 2023-07-07 17:51:46 +00:00
Vladimir Sukharev 4cfcf45120 [K/N] Partially fix IncrementalCompilationTest
^KT-59245
2023-07-07 17:51:46 +00:00
Vladimir Sukharev e240d7aae3 [K/N] Fix test split_compilation_pipeline
^KT-59245
2023-07-07 17:51:46 +00:00
Vladimir Sukharev 32a390ea18 [K/N] K1/MPP: Enable splitting 1-stage to two CLI invocations
^KT-59245 Fixed
2023-07-07 17:51:46 +00:00
Vladimir Sukharev a87b662bc5 [K/N] Split 1-stage K1 compilations to two stages
^KT-59245 Fixed
2023-07-07 17:51:46 +00:00
Sergei Kharitontcev-Beglov 34c6afec5e [Wasm] A name cache to distinguish same named declarations in DCE dump 2023-07-07 17:42:00 +00:00
Sergei Kharitontcev-Beglov bc0afc36a2 [Wasm] Renovated Ir declarations dump by adding a type entry 2023-07-07 17:42:00 +00:00
Sergei Kharitontcev-Beglov 3b52b452a3 [Wasm] Escaped quotes and added export in DCE in IR dumps 2023-07-07 17:42:00 +00:00
Pavel Punegov d5c6dd5f5c [K/N][test] Improve testStackTrace test
Make it print stack trace before the checks
2023-07-07 17:09:40 +00:00
Igor Yakovlev 0a49b79104 [Wasm] Fix debug mode for wasm tests 2023-07-07 15:23:18 +00:00
Igor Yakovlev 750653e4b3 [Wasm] Add kotlin wasm wasi mode compiler flag 2023-07-07 15:23:18 +00:00
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