Commit Graph

110145 Commits

Author SHA1 Message Date
Sergey Bogolepov 5ddd253091 [Swift export] Publish non-embedded artifacts
In some cases we can't use embedded artifact, and need to rely on
un-shadowed paths.

^KT-66702 fixed
2024-03-19 20:32:36 +00:00
Gleb Lukianets b46ffc35f1 KT-65949: Bridge intrinsics
Merge-request: KT-MR-14767
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2024-03-19 19:48:19 +00:00
Svyatoslav Scherbina 7c4c6d2cd9 Bump Kotlin/Native version in KGP to 2.0.0-dev-19230 2024-03-19 18:46:36 +00:00
Iaroslav Postovalov 9a2e4c6b41 [Tests] FIR support in JUnit 3 tests, port necessary subclasses
^KT-64404 Fixed
^KT-64438 Fixed
^KT-64407 Fixed
2024-03-19 17:56:29 +00:00
Kirill Rakhman e69d6d2d05 [FIR/JS] Fix package name check in FirJsPackageDirectiveChecker
#KT-66491 Fixed
2024-03-19 17:06:35 +00:00
Ilya Chernikov 813630d468 K2, Gradle, scripting: unmute test for #KT-61137
The problem is not reproducible anymore, presumingly fixed
with some of the previous updates.
2024-03-19 16:32:25 +00:00
Alexander Udalov 621fe41b17 JVM: restore incorrect DFS logic in JavaModuleGraph for compatibility
The problem is tracked in KT-66622. It should be fixed later, with a
proper deprecation, because otherwise it can potentially break a lot of
code.
2024-03-19 15:51:01 +00:00
Alexander Udalov 94e5cafb61 JVM: fix "module reads" check in JavaModuleGraph
There was a bug in the DFS. Whenever we encountered a "requires
transitive X" directive in some module, we recursively invoked DFS not
on X but on `dependencyName`, which is the target module that we're
trying to find the path to. And that always failed, because no module
requires itself.

 #KT-66275 Fixed
2024-03-19 15:51:01 +00:00
Ilya Chernikov fecc5ba501 K2: do not try to resolve invoke on error receiver
If a potential receiver is resolved to an error type, we consider
any other type as a subtype of it and therefore may select
any candidate that we happen to find in a scope.
In particular, in the case of scripts, or code with a context receiver,
the receiver candidate resolved to a cycle was accepted as a receiver
to an invoke on a random class from stdlib.
The fix skips adding invoke resolve task in this case, allowing
the tower to find the correct candidate in another scope.

#KT-64241 fixed
#KT-65576 fixed
2024-03-19 15:38:35 +00:00
Ilya Chernikov d5ad41fa28 K2 Scripting: add failing test for #KT-64241 2024-03-19 15:38:35 +00:00
Ilya Chernikov 60e38d592c Tests, Scripting: extend custom def test infra with gradle-like def
to be able to test gradle-like DSL
2024-03-19 15:38:34 +00:00
Kirill Rakhman 988edab7a0 [Tests] Add regression test for #KT-58575
#KT-58575 Fixed
2024-03-19 15:34:43 +00:00
Dmitrii Gridin a0120d28cc [FIR] FirResolvePhase: introduce isItAllowedToCallLazyResolveToTheSamePhase
To have explicitly declared contracts
2024-03-19 14:53:28 +00:00
Dmitrii Gridin d67dde8395 [LL FIR] LLFirTargetResolver: rename isJumpingPhase into requiresJumpingLock
to avoid conflicting terms with jumping phases from `FirResolvePhase` KDoc
2024-03-19 14:53:28 +00:00
Dmitrii Gridin c7765258d1 [FIR] FirResolvePhase: introduce isItAllowedToCallLazyResolveTo
To explicitly declare when it is possible to call lazy resolve
2024-03-19 14:53:28 +00:00
Dmitrii Gridin f036954ac0 [LL FIR] LLFirLockProvider: drop checkContractViolations hack
This check was required due to missed proper implementation for
jumping locks. Now it is safe to call `lazyResolveToPhase` under the
jumping lock – it won't lead to any deadlocks or stack overflows.
2024-03-19 14:53:28 +00:00
Johan Bay 04e1e19dfc [K/N] skip lowerings for header caches
^KT-65443
2024-03-19 14:09:44 +00:00
Johan Bay 5adaa9a1f3 [K/N] skip consistency check for header caches
^KT-65443
2024-03-19 14:09:44 +00:00
Johan Bay 0dc646b0d1 [K/N] do not save klib hash in header caches
^KT-65443
2024-03-19 14:09:44 +00:00
Johan Bay 8f325d6f2c [K/N] remove class field types from caches
^KT-65443
2024-03-19 14:09:44 +00:00
Johan Bay 2d7107f354 [K/N] deserialize inline functions for header klibs
For header klibs the indices in the cache for the function bodies
are wrong so we instead deserialize the inline functions up-front.
^KT-65443
2024-03-19 14:09:44 +00:00
Johan Bay 32d67d101a [K/N] add flag to klib manifest for header klibs
^KT-65443
2024-03-19 14:09:44 +00:00
Johan Bay ac524f15d1 [K/N] serialize field names to caches
^KT-65443
2024-03-19 14:09:44 +00:00
Johan Bay b50111cde5 [K/N] add testing setup for header klibs and caches
^KT-65443
2024-03-19 14:09:44 +00:00
Johan Bay 48ce542e95 [K/N] add header_cache output type
^KT-65443
2024-03-19 14:09:44 +00:00
Dmitrii Gridin e1bf85f790 [Analysis API] KtPsiTypeProvider: drop asPsiTypeElement method
This was an implementation detail of SLC.
In the case, if we want to have proper parents for type annotations
in light classes, we have to properly implement `PsiTypeElement`
for required declarations.

^KT-66603
^KT-56870
2024-03-19 13:57:23 +00:00
Dmitrii Gridin 2fbde7a85c [Analysis API] reuse PsiClassRenderer for PsiType render
To align the format with light classes as now we are powered by them

^KT-66603
2024-03-19 13:57:23 +00:00
Dmitrii Gridin 54aee57fec [LC] preserve type annotations from wildcard bound
^KT-66603
2024-03-19 13:57:23 +00:00
Dmitrii Gridin 96575a0bdb [Analysis API FIR] preserve type annotations on asPsiType conversion
^KT-66603 Fixed
2024-03-19 13:57:23 +00:00
Dmitrii Gridin 3c8a95e623 [LC] render all type annotations in tests
^KT-66603
2024-03-19 13:57:23 +00:00
Dmitrii Gridin 66d1839d20 [LC] add tests on nested type annotations
^KT-66603
2024-03-19 13:57:23 +00:00
Dmitrii Gridin cd4f87a8f3 [Analysis API] add tests on KtType conversion with annotations
^KT-66603
2024-03-19 13:57:23 +00:00
Dmitrii Gridin 6ba69482af [Analysis API Fe10] generate ExpressionPsiTypeProviderTest
^KT-66603
2024-03-19 13:57:23 +00:00
Dmitrii Gridin fdc0a8ec07 [Analysis API] render PsiType in tests properly
It should contain fully qualified names and annotations

^KT-66603
2024-03-19 13:57:22 +00:00
Kirill Rakhman 72235b8527 [FIR] Report INNER_CLASS_CONSTRUCTOR_NO_RECEIVER on delegated constructor calls
#KT-59677 Fixed
2024-03-19 12:51:06 +00:00
Sebastian Sellmair a13756cfe9 [aa-klib-reader] Move aa-klib-reader to pkg 'o.j.k.native.analysis.api'
To clearly distinguish this modules API from the Analysis API

^KT-66695 Fixed
2024-03-19 12:35:52 +00:00
Vyacheslav Gerasimov 069c920a5c Build: Use jdk-release compiler option to build kotlin-stdlib
Use JDK11 with `-Xjdk-release=6` for kotlin-stdlib.
Use JDK11 with `-Xjdk-release=7` for kotlin-stdlib-jdk7.
This allows dropping JDK6 and JDK7 from our build completely and remove
`kotlin.build.isObsoleteJdkOverrideEnabled` #KTI-1220.

 #KT-57808
2024-03-19 12:32:39 +00:00
Stanislav Ruban e9d5396fa9 [FIR][checkers] Handle ConeHiddenCandidateError in FirDestructuringDeclarationChecker properly
#KT-66595 Fixed
2024-03-19 12:32:17 +00:00
Stanislav Ruban 89a0cde514 [tests][FIR][checkers] Add test data for KT-66595 2024-03-19 12:32:17 +00:00
Alexander Udalov 8ad38db2ad JVM IR: do not use JvmMethodParameterKind 2024-03-19 11:12:31 +00:00
Alexander Udalov d9bc714992 JVM IR: remove usages of JvmMethodParameterKind.RECEIVER/CONTEXT_RECEIVER
Also slightly refactor ExpressionCodegen.visitCall.
2024-03-19 11:12:31 +00:00
Leonid Startsev dbb7ab1760 Add @Deprecated annotation to a synthetic $serializer class
in K2 so it matches K1 behavior.

Deprecation is required, so the declaration will not be visible to user in completion in the IDE.

#KT-65757 Fixed
2024-03-19 10:57:27 +00:00
Ilya Chernikov 0df3a37303 K2 Scripting, Fir2Ir: allow out of order supertypes declaration
fix script declarations registration logic in Fir2Ir to allow
supertypes of a class to be defined later than the class itself.

#KT-64534 fixed
2024-03-19 08:24:17 +00:00
Dmitriy Novozhilov f18aa5e70f [Test] Add regression test for KT-66638 2024-03-19 07:40:09 +00:00
Marco Pennekamp 9d2298b326 [AA] Resolve isSubClassOf from the context of a use-site session again
`isSubClassOf` was changed in an earlier commit to use the session of
`subClass` instead, but that approach comes with multiple problems:

- We need to resolve classes from the use-site to take actualization of
  `expect` types into account.
- If `superClass` is a builtin and we resolve supertypes from
  `subClass`'s session, we may get multiple instances of symbols for the
  same builtin from different sessions (i.e. one from a stdlib session
  via the use-site session and another from the fallback builtins
  provider for binary libraries if `subClass` is from a binary library).

^KT-66013
2024-03-18 21:14:36 +00:00
Marco Pennekamp 53f2dfec41 [Kapt4] Update Kapt4 test data after AA Standalone fix for sealed inheritors
- The Standalone Analysis API now correctly calculates sealed inheritors
  in source modules. This causes Kapt4 to pick up on sealed subclasses
  in the `modifiers` test. The change is in line with the non-FIR test
  results in `modifiers.txt`.

^KT-66013
2024-03-18 21:14:36 +00:00
Marco Pennekamp 32337c8255 [AA] Render types in sealed inheritors tests as fully expanded types
- This avoids discrepancies between Standalone and IDE mode for sealed
  inheritor tests with type aliases from libraries, because in
  Standalone mode, libraries are deserialized with fully expanded types,
  while in IDE mode, libraries are deserialized from stubs, where type
  aliases are currently not expanded.

^KT-66013
2024-03-18 21:14:36 +00:00
Marco Pennekamp 2e00879fe1 [AA] Add sealed inheritors tests for inheritors with the wrong package
- Inheriting from a sealed class in the wrong package is illegal, so a
  library test makes no sense here, as the test infrastructure wouldn't
  be able to compile the library.

^KT-66013
2024-03-18 21:14:36 +00:00
Marco Pennekamp ed62211e06 [AA] Add packages to sealed inheritors tests
^KT-66013
2024-03-18 21:14:36 +00:00
Marco Pennekamp 4fa0f1316d [AA Standalone] Refactoring: Rename testKtFiles to sourceKtFiles 2024-03-18 21:14:36 +00:00