Commit Graph

103859 Commits

Author SHA1 Message Date
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
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