Commit Graph

104076 Commits

Author SHA1 Message Date
Mikhail Glukhikh 27afee8683 K2: generate bounds for inner-class based raw types properly
#KT-58579 Fixed
2023-08-22 11:40:26 +00:00
Mikhail Glukhikh 4e2067a163 K2: reproduce KT-58579 2023-08-22 11:40:25 +00:00
Mikhail Glukhikh 2ff075c961 FIR2IR: use ELVIS origin only on wrapping blocks #KT-60250 Fixed 2023-08-22 11:20:19 +00:00
Mikhail Glukhikh b06188180e FIR2IR: don't generate 'none' type arguments for Java field references
#KT-60254 Fixed
2023-08-22 11:20:19 +00:00
Mikhail Glukhikh 9846ec23df Raw FIR: generate 'return setValue' instead of just 'setValue'
#KT-61045 Fixed
2023-08-22 11:20:19 +00:00
Mikhail Glukhikh 7d5e2f85cc FIR2IR: don't generate unnecessary 'return throw'
#KT-60245 Fixed
2023-08-22 11:20:19 +00:00
Vladimir Sukharev 90904e4f8a [Tests] Add missing diagnostics handler to irText tests
Merge-request: KT-MR-11721
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-08-22 10:44:41 +00:00
Nikita Bobko ccfbb5f77a [FE] Don't issue a deprecation warning for open val deferred init when the property is unconditionally effectively final
^KT-61228 Fixed
Review: https://jetbrains.team/p/kt/reviews/11694/timeline
2023-08-22 10:15:22 +00:00
Nikolay Lunyak c33f1cda69 [FIR] Report MISSING_CONSTRUCTOR_KEYWORD
^KT-59407 Fixed
2023-08-22 09:13:16 +00:00
Nikolay Lunyak f238ffa4bf [FIR] Make FirErrorConstructor a FirDiagnosticHolder 2023-08-22 09:13:16 +00:00
Roman Efremov 673b4b4d52 [FE] Add OptIn annotation to whitelist of annotation checker
It's valid to have `@OptIn` only on `expect` declaration.

^KT-61373
2023-08-22 09:02:20 +00:00
Pavel Kunyavskiy 8bcd1f4efa [FIR/Native] Move fir-related code from backend.native module to new one
^KT-61249
2023-08-22 08:56:16 +00:00
Alexander Udalov fdab636a1b Tests: add missing language version in a Java modules test
The main function in this test class to compile a bunch of sources is
`module`, which was changed to test different language versions in
4e706ba93e. But this test uses `compileLibrary` directly, so we need to
pass LV manually.

 #KT-60797
2023-08-22 08:34:18 +00:00
Dmitrii Krasnov ade88e2b0f Fixed konan.data.dir with caches
Removed TODOs after updating to kotlin bootstrap version with konan.data.dir gradle property changes

Fixed warning of incorrect passing -Xkonan-data-dir arg in konanc from KGP and fixed setting konan-data-dir in SetupConfiguration#setupCommonOptionsForCaches

#KT-60660 Fixed

Merge-request: KT-MR-11299
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-08-22 07:56:26 +00:00
Yahor Berdnikau e8905ea849 [Gradle] Fix loosing compiler plugin options with the same plugin ID
The most common use case is to add one CompilerPluginOptions to another
while both may have options with the same plugin ID.

^KT-54160 Fixed
2023-08-22 07:53:18 +00:00
Nikolay Krasko df55283148 Revert "[Build] Fix usage of --scan parameter with test retry"
It looks like tests retry doesn't work sometimes.

This reverts commit ecd06ac47b.

KTI-1346 KTI-1339
2023-08-21 21:01:18 +00:00
Dmitrii Gridin 695f6f0062 [SLC] fix annotation retention mapping
^KT-61377 Fixed
2023-08-21 20:46:25 +00:00
Dmitrii Gridin 566232fd0d [SLC] add test for binary retention
^KT-61377
2023-08-21 20:46:25 +00:00
Dmitrii Gridin 51cc799204 [SLC] fix flaky test 2023-08-21 20:46:25 +00:00
Dmitrii Gridin 175ce94bb5 [LL FIR] StubBasedClassDeserialization: provide psi class there is possible
We can provide psi declaration for nested classes to avoid search
through providers and improve stability

^KTIJ-26670 Fixed
2023-08-21 20:42:44 +00:00
Dmitrii Gridin faac4ad229 [LL FIR] add cache restoring in some situations
In some caches, we assume that the resulting value must be not null if
we provide a context, so we can fix the cache inconsistency in this case.
This is error situations that shouldn't happen, but currently we have
problems with script dependencies (KT-61267), so such checks will help
us to distinguish some LL FIR problems from dependency problems.

^KT-61331 Fixed
^KTIJ-26670
2023-08-21 20:42:44 +00:00
Nikita Bobko ad90c86abe jvm-minimal-for-test: apply module-wise -opt-in=kotlin.ExperimentalMultiplatform
Motivation: Consistency. All other stdlib modules use this module-wise
`-opt-in`
2023-08-21 19:51:08 +00:00
Nikita Bobko 25c082f02b K1: Implement a checker that disallows to have different member scopes for expect open and its actual
^KT-22841 Fixed
Review: https://jetbrains.team/p/kt/reviews/11603/timeline

The commit also introduces `@AllowDifferentMembersInActual` annotation in
stdlib which allows to suppress the diagnostic
2023-08-21 19:51:08 +00:00
Alexander.Likhachev 797ca34a34 [BT] Use bootstrap classloader as a fallback instead of system classloader
Using system classloader may lead to unwanted leakage of classes from the application classpath (like Gradle's ones).
#KT-61206 Fixed
2023-08-21 18:09:49 +00:00
Alexander.Likhachev 4705f13b39 [BT] Add a test for KT-61206 2023-08-21 18:09:49 +00:00
Igor Chevdar 9917c477e8 [K/N][linker] Name temp obj file the same as output binary
#KT-61270 Fixed
2023-08-21 18:06:02 +00:00
Kirill Rakhman d0cc86f52c [Tests] Update test data after changes to FIR diagnostic messages 2023-08-21 16:28:48 +00:00
Kirill Rakhman de1c92a32f [FIR] Update diagnostic messages 2023-08-21 16:28:48 +00:00
Kirill Rakhman 6cd9b5ec98 [FIR] Add guidelines for diagnostic messages 2023-08-21 16:28:48 +00:00
Kirill Rakhman aacbcc9d49 [FIR] Verify diagnostic messages use single quotes correctly 2023-08-21 16:28:47 +00:00
Roman Golyshev b760046f93 KTIJ-26713 [AA] Clean-up KtFirReferenceShortener
- revert some accidental changes in
`findSmallestElementOfTypeContainingSelection` function (see 48433bf9)
- simplify `dropFakeRootPrefixIfPresent` by using `tail`, add a new
test-case to check that it works
- simplify `findClassifierElementsToShorten` by not passing lambdas and
calling a common functions instead
2023-08-21 16:22:22 +00:00
Roman Golyshev 24a13348c4 KTIJ-26713 [AA] Handle FirFunctionTypeParameter in KtFirReferenceShortener
^KTIJ-26713 Fixed
2023-08-21 16:22:22 +00:00
Nikita Bobko 830084a678 Revert "Force recompile all call-sites of ExpectedActualResolver.{findActualForExpected, findExpectedForActual}"
This reverts commit 529a1dd720.

This commit was needed to workaround broken incremental compilation in
JPS in Kotlin plugin. The incremental compilation bug is reported
KT-60759

As promised in 529a1dd720, after a few
days in `master` I revert it

Review: https://jetbrains.team/p/kt/reviews/11724/timeline
2023-08-21 15:11:33 +00:00
Svyatoslav Scherbina 04d01e381f Native: disable running cinterop in Gradle process when building K/N
Building Kotlin/Native itself involves running cinterop in the Gradle
daemon process to reduce build time.
But this optimization appears to be incorrect when reusing Gradle daemon
for subsequent builds.

This commit disables the optimization by default, keeping enabling it
possible using `kotlin.native.allowRunningCinteropInProcess=true`
project property.

For more details see ^KT-61300
2023-08-21 14:15:28 +00:00
Dmitrii Gridin 3d52ba3bca [psi] KtFile: add hasImportAlias with caching
We have hotspots in UAST due to aliases, so we can reduce the time
significantly by caching `hasImportAlias` property

^KTIJ-26688
2023-08-21 13:57:10 +00:00
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