Commit Graph

103841 Commits

Author SHA1 Message Date
Dmitriy Novozhilov efb96e31fb [FIR] Fix implementation of primaryConstructorSymbol utility
Originally it used list of declarations, which is incorrect, because
  some constructors may be contributed by compiler plugin. And those
  constructors will be contained only in scope
2023-08-21 13:51:12 +00:00
Ilya Gorbunov 93b0a90172 Add missing SinceKotlin for new JS annotations, KT-6168 2023-08-21 12:49:21 +00:00
Kirill Rakhman fa77e3952d [FIR] Bring equivalent call behavior closer to K1
#KT-61159 Fixed
2023-08-21 12:11:58 +00:00
Igor Chevdar 7c67e9e08b [tests][lldb] Added a reproducer for #KT-61131 2023-08-21 12:05:28 +00:00
Igor Chevdar c1874d0184 [K/N][codegen] Added debug info to virtual functions trampolines
#KT-61131 Fixed
2023-08-21 12:05:28 +00:00
Roman Golyshev 10df37ba8e KTIJ-26423 [AA] Return more info from KtFirImportOptimizer
Deprecate `unusedImports`, since they are supposed to be computed
on the IDE side from now on based on the information from
Analysis API

Currently the `unusedImports` property is not removed completely
so it can still be used by the Kotlin side import optimizer
tests; they should be moved/adapted to the intellij repository
also
2023-08-21 10:46:58 +00:00
Kirill Rakhman 43180597fe [FIR] Fix generic sam conversion in call completion
#KT-60903 Fixed
2023-08-21 10:35:42 +00:00
Kirill Rakhman 3ecadf1af7 [FIR] Use shared FirSamResolver in call completion 2023-08-21 10:35:42 +00:00
Aleksei.Cherepanov e1c399b353 Fix JPS import after 7ae443ad 2023-08-21 10:11:55 +00:00
Ilya Kirillov 8fe20d2b06 [codeowners] set "Kotlin IDE Analysis Core" as owners of Analysis API subsystem
After the team restructuring
2023-08-21 11:10:30 +02:00
Dmitrii Krasnov 304cbf1aea Fixed configuration cache misses for the second build, when K/N compiler has been downloaded with the first build
KT-61154 Fixed
2023-08-19 05:45:12 +00:00
Ilya Chernikov f8b789164c Remove long unused DI annotation PostConstruct
we broke its contract a long time ago, so it is obviously unused
but breaks some Java EE verifications
#KT-32275 fixed
2023-08-18 19:58:07 +00:00
Ilya Gorbunov c49934160a Remove wasm platform handling from stdlib dependency autoconfiguration
Wasm variants of common kotlin-stdlib now provide the required artifacts.
No support of previous versions is required due to experimental status.

KT-60909, KT-59000
2023-08-18 15:36:15 +00:00
Ilya Gorbunov 9640e32483 [stdlib-mpp] Publish wasm artifacts through variants of stdlib KT-60909 2023-08-18 15:36:15 +00:00
Nikolay Lunyak 73b4a81663 [FIR] Forbid complex boolean expressions
Disabling the language feature is supported,
otherwise there are too many tests that
would need to be updated to account for
K2's inability to do it.

The `ifConstVal.kt` test is deleted,
because now it must also be ignored in K2,
and since it is ignored for both the
frontends, and the ignored backends
include all the target backends, this test
is basically unused.

Note that now both the frontends report
`CONST_VAL_WITH_NON_CONST_INITIALIZER`.
for `condition`.

^KT-55196 Fixed
2023-08-18 15:16:13 +00:00
Kirill Rakhman 79fe48ab5b [FIR2IR] Support error qualifier in case of error suppression
#KT-60536 Fixed
2023-08-18 14:28:56 +00:00
Alexander.Likhachev 51a43a02f7 [IC] Restore old IncrementalCompilationContext constructor for KSP compatibility 2023-08-18 14:20:57 +00:00
Alexander.Likhachev 4d1ea3c441 [Gradle] Avoid early reading of Project.buildDir in compilation tasks
#KT-61292 Fixed
2023-08-18 14:20:57 +00:00
Alexander.Likhachev 7c5a826fd8 [Gradle] Add a test for KT-61292 2023-08-18 14:20:57 +00:00
Nikolay Lunyak 2c16c9a35b [FIR] Remove a hack about local classes
^KT-54390 Fixed
2023-08-18 13:31:04 +00:00
Nikolay Lunyak f9c6af4d2a [FIR] Properly assign <local> packages to symbols
This prevents `FirConflictsExpressionChecker.kt`
from missing conflicting local functions. It used
to due to inconsistencies in assigning `<local>`,
and this commit makes it a bit more
straightforward.

The change in KtClassTypeQualifierRenderer
prevents `FirOverrideImplementTest.testLocalClass`
from failing in `intellij`. It didn't fail for
callables, because `KtCallableSignatureRenderer`
doesn't try to render packages.

^KT-59186 Fixed
2023-08-18 13:31:04 +00:00
Nikolay Lunyak cf655fd5ad [FIR] Report CONFLICTING_OVERLOADS for local functions
^KT-59186 Fixed
2023-08-18 13:31:04 +00:00
Nikolay Lunyak 6fa5363cf4 [FIR] FirDeclarationInspector -> FirDeclarationCollector<T>
Makes more sense when you only want to collect
declarations of certain type.
2023-08-18 13:31:03 +00:00
Kirill Rakhman 5b9c35de2e [Tests] Update test data with error suppression warnings
#KT-61129 Fixed
2023-08-18 13:29:20 +00:00
Kirill Rakhman 969c716c76 [FIR] Implement flag for disabling warning on error suppression
#KT-61129
2023-08-18 13:29:20 +00:00
Kirill Rakhman c32a0a83f9 [FIR] Report warning when error is suppressed
#KT-61129
2023-08-18 13:29:20 +00:00
Kirill Rakhman 769e4ac0ac [FIR] Generate list of error names that shouldn't be suppressed
#KT-61129
2023-08-18 13:29:20 +00:00
Kirill Rakhman 3255bcfbee [FIR] Add tests for #KT-54670 2023-08-18 13:08:25 +00:00
Ilya Chernikov a53933d8ce Scripting: do not pack generic dependencies jar into maven-all
The -all jar is compacted with proguard, and the proguard removes
synthetic methods methods with $default suffix from classes regardless
of the -keep flag.
Therefore the calls to the $default metods lead to the NoSuchMethodError
exception on runtime.
Removing the main interface module from the proguarded jar solves the
problem for now (but not generally, the use of "proguarded" jars as
libraries should be discouraged.)
#KT-60862 fixed
2023-08-18 12:35:25 +00:00
Ilya Kirillov e763e71515 [FIR] optimize ConeTypeProjection[] RAM usage for empty arrays
On the snapshot from ^KTIJ-26260 empty ConeTypeProjection arrays take about 10mb
2023-08-18 11:36:42 +00:00
Ilya Kirillov bdfc68468f [FIR] optimize direct allocation of empty ConeTypeProjection arrays
On the snapshot from KTIJ-26260 empty ConeTypeProjection arrays take about 10mb
2023-08-18 11:36:42 +00:00
Bogdan Mukvich 04d330edae Add cleaning instruction to artifacts tests README 2023-08-18 11:01:56 +00:00
Alexander Udalov d81c79b3bc Tests: fix language version in tests about PRE_RELEASE_CLASS
Do not force language version to be LATEST_STABLE. There are now two
versions of this test, one for K1 (LV <= 1.9) and another for K2 (LV >=
2.0), and language version is chosen automatically in `compileKotlin`.
2023-08-18 10:49:48 +00:00
Alexander Udalov 9de6df6104 Tests: improve logic of replacing versions with templates
To slightly reduce the number of test data that needs to be changed when
Kotlin switches to a new language version.
2023-08-18 10:49:48 +00:00
Alexander Udalov a58a1a3398 Reflection: do not try to box COROUTINE_SUSPENDED
#KT-58887 Fixed
2023-08-18 10:35:34 +00:00
Kirill Rakhman bd6af5cc42 [FIR2IR] Set correct modality of lazy annotation classes
#KT-60268 Fixed
2023-08-18 09:43:40 +00:00
Roman Golyshev 52d6ac5ed0 [AA] Fix processing of member invoke functions from objects in reference shortening and import optimization
Correctly handle `KtDotQualifedExpression`s with function calls as
selectors (like `foo.Bar()`). Without such handling, processing of
member invoke calls on objects was broken both
for reference shortener (causing KTIJ-26695)
and import optimizer (causing KTIJ-23407)

Also, to fix KTIJ-23407, do not ignore qualifiers with
`ImplicitInvokeCall` fake source

^KTIJ-26695 Fixed
^KTIJ-23407 Fixed
2023-08-18 07:32:05 +00:00
Nikolay Lunyak 4958196c51 [FIR] Forbid mixing supertypes with different functional kinds
^KT-61277 Fixed
2023-08-17 21:45:42 +00:00
Nikolay Lunyak f674529558 [FIR] Report MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES
^KT-59367 Fixed
2023-08-17 21:45:42 +00:00
Alexander Udalov b3e4099703 Kapt tests: minor, remove STRIP_METADATA from properties.kt 2023-08-17 21:43:54 +00:00
Alexander Udalov e700a38a87 Kapt tests: minor, add some cases to properties.kt
To check that boolean "is" prefix is treated correctly, and Unit return
type is not translated to void. `@Deprecated` annotations are added just
so that the `$annotations` methods would also be generated.
2023-08-17 21:43:54 +00:00
Alexander Udalov 28e232f54f Kapt tests: minor, add case with optimized delegated property
In normal circumstances, it leads to the field `c$delegate` NOT being
generated (see KT-39054). However, it's not the case in kapt in any
mode:
- In the old JVM backend, this optimization is not supported.
- In JVM IR, property initializers are missing in light analysis, so
  backend cannot figure out that this property is optimizable.
- In kapt4, backend is not being run, and symbol light classes do not
  have information about this optimization.

Overall it doesn't matter much which stub is generated here because the
field is private, the test is added just in case.
2023-08-17 21:43:54 +00:00
strangepleasures 2423b7b62f [KAPT4] KT-51982 Implement generation of @Metadata annotations in Java stubs
Also adds rendering of @Metadata annotations in Kapt3 and Kapt4 tests
(currently disabled for a few tests).

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2023-08-17 21:43:54 +00:00
Alexander Udalov f40fc1b0c6 JVM IR: minor, deduplicate JvmFileClassUtil.manglePartName 2023-08-17 21:43:54 +00:00
Ilya Gorbunov 69cb722ff4 Add js compiler disambiguation attribute to fix docs build 2023-08-17 17:21:23 +00:00
Dmitrii Gridin 0487bd7b6a [LL FIR] do not treat phase from FirFile as indicator for entire file
`resolvePhase` from `FirFile` is not an indicator of resolution state for
the entire file, so we shouldn't depend on it.
The right check will be performed during `lazyResolveTargets` over `LLFirResolveTarget`

^KTIJ-26666 Fixed
^KT-61296
2023-08-17 17:06:26 +00:00
Sebastian Sellmair 337d87ad54 [Gradle] CInterop IDE dependency resolution: Fix build dependencies
^KT-59596 Verification Pending
2023-08-17 15:47:56 +00:00
Sebastian Sellmair fac5083dbf [Gradle] Ensure 'commonized cinterop configurations' are present and expose api dependencies
^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka 9866336a40 [Gradle] Use 'commonized cinterop configurations' as single way of sharing cinterop commonizer output
^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka b2bef4ad41 [Gradle] Extract allInteropGroups from CInteropCommonizerTask
This information is needed to create consumable configurations for
Commonized Cinterop outputs. This way CInteropCommonizerTask is not
required to be created eagerly.

^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00