Commit Graph

107361 Commits

Author SHA1 Message Date
Sergej Jaskiewicz ff1b618dfd [K/N] Move KonanIdSignaturer to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 7e3b909394 [K/N] Move some utils to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 69cdf2d3ea [K/N] Move ModuleDescriptor#isFromInteropLibrary to util-klib-metadata
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz e521ed9dc3 [K/N] De-duplicate BaseKotlinLibrary#isInteropLibrary
KT-64392
2023-12-19 15:20:00 +00:00
Dmitriy Dolovov 61282fcaeb IR text tests: New tests specifically for main functions mangling
^KT-57755
2023-12-19 14:24:16 +00:00
Dmitriy Dolovov af247c3344 IR text tests: Unmute tests that have main function
Don't use `main` function in these tests, because `main` function
has specific mangling rules in JVM. Use other function name.

^KT-57755
2023-12-19 14:24:16 +00:00
Dmitriy Dolovov 1759b9e3c4 IR text tests: Use suffix 'by Frontend' for FIR & descriptor based signature mangled names
IrMangledNameAndSignatureDumpHandler can dump either signature mangled
names by Fir or by descriptors, but not both at the same time. And
mangled names should be equal to preserve ABI compatibility.

^KT-57788
2023-12-19 14:24:16 +00:00
Yahor Berdnikau c9ad09f4dc [Gradle] Fix deprecated buildDir access in PublicPackageJsonTask
^KT-62527 In Progress
2023-12-19 14:09:55 +00:00
Yahor Berdnikau 28405fceac [Gradle] Suppress unused task input
^KT-56904 In Progress
2023-12-19 14:09:55 +00:00
Yahor Berdnikau f0e6244498 [Gradle] Add suppression for internal deprecation
^KT-56904 In Progress
2023-12-19 14:09:55 +00:00
Yahor Berdnikau f783317dca [Gradle] Slightly update KDoc to fix warning
^KT-56904 In Progress
2023-12-19 14:09:55 +00:00
Yahor Berdnikau 7911cc640b [Gradle] Remove unused variable
^KT-56904 In Progress
2023-12-19 14:09:55 +00:00
strangepleasures b32f408767 [KAPT] KT-64389 Fix stub generation with generic type constraints 2023-12-19 13:33:38 +00:00
Mikhail Glukhikh 4783822fbc K1/K2: add test confirming the work of KT-54487 case
#KT-54487 Obsolete
#KT-63350 Declined
2023-12-19 12:24:37 +00:00
Yahor Berdnikau 601f90917b [Gradle] Don't use reflection to get java compile task provider
^KT-56904 In Progress
2023-12-19 11:51:40 +00:00
Yahor Berdnikau 8fc847fe5c [Gradle] Mark setupDependenciesResolution function as private
^KT-56904 In Progress
2023-12-19 11:51:40 +00:00
Yahor Berdnikau 1b09ca4001 [Gradle] Don't use reflection to get packageTask provider
^KT-56904 In Progress
2023-12-19 11:51:40 +00:00
Yahor Berdnikau 5e2bf34ff7 [Gradle] Migrated from deprecated compileKotlinTaskProvider
^KT-56904 In Progress
2023-12-19 11:51:40 +00:00
Yahor Berdnikau cab734f57e [Gradle] Remove unnecessary cast
^KT-56904 In Progress
2023-12-19 11:51:40 +00:00
Yahor Berdnikau 1ead664f91 [Gradle] Update the usage of defaultSourceSetName
^KT-56904 In Progress
2023-12-19 11:51:40 +00:00
Yahor Berdnikau 3130775a3b [Gradle] Suppress usages of Android deprecated types in AndroidProjectHandler
^KT-56904 In Progress
2023-12-19 11:51:40 +00:00
Marco Pennekamp 145876a235 [K/N] Fix disposable leak in ExtTestCaseGroupProvider.isIgnoredTarget
- `isIgnoredTarget` creates a new `ExtTestDataFileStructureFactory`,
  which requests a shared application environment via
  `createPsiFactory`.

^KT-64099
2023-12-19 11:12:23 +00:00
Marco Pennekamp 24a2f72a6b [Test] ReplCompilerJava8Test: Fix lifetime of setUp environment
- For each test, `ReplCompilerJava8Test` effectively created two
  environments: one in `setUp` for pre-compilation and one in `runTest`
  managed by `GenericReplCompiler`. The `setUp` environment is unshared,
  so it wasn't the same as the one managed by `GenericReplCompiler`.
  Because the `setUp` environment was registered with
  `testRootDisposable`, its application and project were effectively
  disposed at the end of the test, together with the other environment.
- Adding a call to `resetApplicationManager` to
  `KotlinCoreEnvironment.disposeApplicationEnvironment` in a previous
  commit caused `ReplCompilerJava8Test` to fail with the following
  sequence:
  1. At the end of a test, `testRootDisposable` is disposed.
  2. The project count disposable registered in
     `getOrCreateApplicationEnvironment` is disposed first. This causes
     the shared application's project count to go to 0 and triggers its
     disposal via `disposeApplicationEnvironment`.
  3. In `disposeApplicationEnvironment`, the application manager's
     application is reset to `null`.
  4. The disposer continues with disposables which were registered for
     the `setUp` environment initially. One of these is
     `PsiManagerImpl`, which disposes `FileManagerImpl`, during whose
     disposal `ApplicationManager.getApplication()` is called. Since the
     application was reset, it is now `null` and an NPE occurs.
- The solution disposes the `setUp` environment early so that it cannot
  clash with the shared environment from `GenericReplCompiler`.

^KT-64099
2023-12-19 11:12:23 +00:00
Marco Pennekamp 5f6ffc55b8 [Test] Wrap Disposer.dispose calls in finally
- This ensures that disposables are disposed on test failure as well.

^KT-64099
2023-12-19 11:12:23 +00:00
Marco Pennekamp 76a4b32c1f [Test] JS backend recompilation tests: Dispose the test root disposable of the subordinate incremental configuration
- The incremental configuration for JS recompilation tests creates its
  own test root disposable. It needs to be properly handled to avoid
  disposable leaks.
- The incremental configuration's disposable is registered with the
  parent configuration's disposable because it lives in its scope and
  should thus not be a root disposable. It's also disposed at the end of
  `transform` because the incremental configuration's lifetime ends
  there.

^KT-64099 fixed
2023-12-19 11:12:23 +00:00
Marco Pennekamp a4fc658fb3 [Test] Use testRootDisposable instead of leaking test disposable in ApiTest
- `testDisposable` is already managed by `KtUsefulTestCase`, so disposal
  support comes for free. This replaces the previous `TestDisposable`,
  which was never disposed properly.

^KT-64099
2023-12-19 11:12:23 +00:00
Marco Pennekamp 3497809ebd [Test] Add missing disposal for test root disposables
^KT-64099
2023-12-19 11:12:23 +00:00
Marco Pennekamp 32fe29b8cc [Test] Add debug names to unnamed test disposables
- This helps to track down disposables which are never disposed, and
  reduces confusion when printing disposables in general (the names will
  now be meaningful, instead of endless lists of "newDisposable" and
  "TestDisposable").

^KT-64099
2023-12-19 11:12:23 +00:00
Marco Pennekamp bba5447b12 [Test/AA] Pass project disposable to getOrCreateApplicationEnvironment instead of application disposable
- The disposable passed to `getOrCreateApplicationEnvironment` should
  not actually be the application environment's disposable, which is
  created inside the function. Instead, it should be the project's
  disposable, which is used to track how many projects still rely on the
  shared application environment.
- This issue wasn't apparent before because there is no visible
  consequence when an application isn't disposed after all projects have
  been disposed (during tests). However, the solution for KT-63650
  relies on application environments being disposed after all projects
  are disposed, so that a new application environment with a different
  configuration can be created. (Only one shared application environment
  may be active at the same time.)

^KT-63650
2023-12-19 11:12:23 +00:00
Marco Pennekamp 85c4d6b67b [FIR] Add workaround for exception in JavaOverrideChecker.buildErasure
- `useMutableOrEmpty` causes the bounds to be replaced atomically, which
  avoids the race described in KT-60324.

^KT-60324 fixed
^KT-60445
2023-12-19 11:10:06 +00:00
Vladimir Sukharev 73032213f0 [K/N][Tests] Adjust moved codegen tests to new infra
^KT-61259
2023-12-19 10:57:24 +00:00
Vladimir Sukharev 71a834b778 [K/N][Tests] Move codegen test sources cycles..innerClass
^KT-61259
2023-12-19 10:57:24 +00:00
Anna Kozlova 35d2be25b2 [psi] extract KtCommonFile which doesn't depend on java psi
should not be used directly

^KT-64409 fixed
2023-12-19 10:39:11 +01:00
Anna Kozlova 687a23be47 [psi] remove KtEnumEntry#isEquivalentTo
This check is used in equivalence check which is symmetric, and
java refers to kotlin through light classes.
LC implementation already contains support for matching
 wrapped and origin kotlin members,
 both K1 and K2 LC implementations.
 Thus, this check is redundant.
 Removing it, we cleanup kotlin psi from java psi
2023-12-19 10:37:18 +01:00
Anna Kozlova f9fb8e3ddf [psi] remove PsiClassHolderFileStub<KtFile> from KotlinFileStubImpl
it's used in ClsFile only, and kotlin has its own decompiled hierarchy
2023-12-19 10:37:18 +01:00
Simon Ogorodnik f4c7f513ef K2 Tests. Do not use the TopDownAnalyzerFacadeForJVM to create module descriptor
In fact, TopDownAnalyzerFacadeForJVM.createContainer initializes the
whole K1 frontend. While it is only used to create a module descriptor
for GenerationState.Builder, in real K2 compiler the module descriptor
would be created via irModuleFragment.

See org.jetbrains.kotlin.cli.jvm.compiler.pipeline.CompilerPipelineKt.generateCodeFromIr
2023-12-19 09:25:11 +00:00
Vladimir Sukharev 023cce1fab [K/N] Fix NPE in special backend checks and interop lowering
^KT-63049 Fixed
2023-12-19 09:15:39 +00:00
Vladimir Sukharev b1508a49ac [K/N] Add failed test for KT-63049
^KT-63049
2023-12-19 09:15:39 +00:00
Dmitriy Novozhilov fa33c5dc79 [FIR] Implement deprecation warning for synthetic without java base getter
Also implement new resolution behavior under language feature

^KT-63076 Fixed
^KT-64358
2023-12-19 09:04:26 +00:00
Dmitriy Novozhilov d5b0a5b220 [FIR] Add some safe API to synthetic property symbols
Previously there were no way to get delegated function symbol of accessor
  symbol of synthetic property
2023-12-19 09:04:26 +00:00
Dmitriy Novozhilov be6694f049 [Test] Add tests for KT-63076 2023-12-19 09:04:26 +00:00
Anton Lakotka 63d615d220 [Gradle] Fix compilation warnings
^KT-62527 In Progress
2023-12-19 08:39:00 +00:00
Anton Lakotka 0264fc29b8 [Gradle] Fix defaultSourceSetName usages
^KT-62527 In Progress
2023-12-19 08:38:59 +00:00
Dmitrii Gridin a824a8f86d [Analysis API] StandaloneModeLibraryBinaryTestConfigurator: drop sealed preprocessor 2023-12-19 07:03:31 +00:00
Jinseong Jeon 4c7e9f3cbf AA standalone: more tests about resolving properties in nested class/object from binary 2023-12-19 07:03:31 +00:00
Jinseong Jeon d603115def AA standalone: set binary dependency kind in test configurator 2023-12-19 07:03:30 +00:00
Jinseong Jeon 92d6aeb7a3 LC: lookup backing field of property in decompiled class/companion
^KTIJ-27684
2023-12-19 07:03:30 +00:00
Jinseong Jeon e5095a60ba K2 UAST: lookup properties in the containing class, not companion object
...because properties in the companion object are materialized
in the containing class.

^KTIJ-27684 fixed
2023-12-19 07:03:29 +00:00
Jinseong Jeon 10c9b81c79 AA standalone: introduce multi-module binary dependency test 2023-12-19 07:03:29 +00:00
Jinseong Jeon 3c775c4a42 Fix dependency kind explanations
They are directly used for enum valueOf, and the enum constants are not
all capitals. Instead, only the first letter is capital.
2023-12-19 07:03:28 +00:00