Commit Graph

105568 Commits

Author SHA1 Message Date
Ivan Kylchik 4334ae9da9 [FIR] Add JvmName to the list of REQUIRED_ANNOTATIONS
We need to resolve `JvmName` as soon as possible because
it can be analyzed in `FirJavaElementFinder` to create
the correct class stub.

#KT-57802
2023-10-20 16:33:20 +00:00
Ivan Kylchik a45bb8d92b [FIR] Find the correct FIR file in Java finder for file with JvmName
#KT-57802
2023-10-20 16:33:20 +00:00
Ivan Kylchik 8c7c44f9f5 [FIR] Fix evaluation of Java properties for Char and String types
#KT-57802
2023-10-20 16:33:20 +00:00
Ivan Kylchik bf6f241d4a [FIR] Reuse transformConst method to evaluate properties in Java world
#KT-57802
2023-10-20 16:33:20 +00:00
Ivan Kylchik 4d9b4dd27f [FIR] Use lazy evaluation for FIR Java properties
This is needed to avoid recursive evaluations when we have
multiple `const val` properties in a single class or file.

#KT-57802
2023-10-20 16:33:20 +00:00
Ivan Kylchik 7935b2bdb1 [FIR] Allow to evaluate top level const properties in Java world
#KT-57802
2023-10-20 16:33:20 +00:00
Ivan Kylchik 886ef1a4b4 [FIR] Support the simple case of java field interpretation
#KT-57802
2023-10-20 16:33:20 +00:00
Ivan Kylchik 2af73c2b13 [FIR] Add FirJavaElementFinder to session's components
This change allows us to use `IrInterpreter` to evaluate Kotlin's
const properties that were called from Java world

#KT-57802
2023-10-20 16:33:20 +00:00
Ivan Kylchik fbe00b1b91 [FIR] Add Fir2IrLazyField class
This class will be used to delay const evaluation of java fields
until IR tree is built.

#KT-57802
2023-10-20 16:33:20 +00:00
Ilya Gorbunov bd6607c860 Drop kotlin-stdlib-wasm project
Its tasks are no longer used as build entry points
2023-10-20 16:27:30 +00:00
Ilya Gorbunov 892719171b Disable wasm-wasi stdlib tests execution unless kotlin.stdlib.wasi.tests property is specified
Reason: unstable on CI
KT-62694
2023-10-20 16:27:30 +00:00
Alexander.Likhachev f630a27f14 [Build] Fix configuration cache issue in KGP IT
`project` cannot be used at execution time.
^KTI-1433 Fixed
2023-10-20 15:42:57 +00:00
Nikita Bobko fa89b8b0f1 [FE 1.0] 2/2 Don't report a warning when new members are added to open expect actualization
^KT-62655 Fixed
2023-10-20 14:37:10 +00:00
Nikita Bobko 1d4ab50047 [FE 1.0] 1/2 Don't report a warning when new supertypes are added to open expect actualization
^KT-62655 Fixed
2023-10-20 14:37:10 +00:00
Nikita Bobko a537ab898e [FE 1.0] Refactoring: replace defensive NonPrivateCallableAdded with Unknown
Motivation: I'm going to drop NonPrivateCallableAdded (KT-62655) in the
next commits. But I don't want to change the existing logic when I drop
it. That's why I have to introduce the "Unknown" case
2023-10-20 14:37:10 +00:00
Nikita Bobko 12f932a63a [FE 1.0] Report a more precise diagnostic when parameter modifiers (vararg) are changed in actualization
^KT-62747 Fixed
2023-10-20 14:37:10 +00:00
Nikita Bobko 0f82baf841 [FE 1.0] 2/2 Drop AllowDifferentMembersInActual from compiler and testData
The annotation was dropped in the previous commit
2023-10-20 14:37:09 +00:00
Nikita Bobko 14029b0ebc [STDLIB] 1/2 Drop AllowDifferentMembersInActual from stdlib
^KT-62656 Fixed

I blindly converted all `@AllowDifferentMembersInActual` to suppresses.
But some suppresses in stdlib are redundant. I'm too lazy properly
annotate only the necessary places. All these suppresses will go away
after the bootstrap update anyway

I drop allowDifferentMembersInActual_class and
allowDifferentMembersInActual_typealias tests because their only purpose
was to check that `@AllowDifferentMembersInActual` works as expected

Note: some tests are failing in the compiler because of that. I will fix
them in the next commit
2023-10-20 14:37:09 +00:00
Dmitriy Novozhilov 8b03636b3b [Test] Unmute test due to KT-62058 2023-10-20 14:32:43 +00:00
Dmitriy Novozhilov 33e9ed37e4 Revert "[Build] Return the logic to force LV=1.9 for KGP and its dependencies"
This reverts commit 274198d8
Original commit is not needed anymore after bootstrapping on 9fd14456
2023-10-20 14:32:43 +00:00
Artem Kobzar 4a042dafef [K/JS] Fix nameBindings for ES-modules after the ES-modules external declarations optimization 2023-10-20 14:04:39 +00:00
Marco Pennekamp 72438f4969 [AA] Remove obsolete memberScopeByFqName test data
- The test data was already moved to `memberScope`, but some files were
  not deleted (see: 67ac985be7).
2023-10-20 13:28:12 +00:00
Roman Golyshev 0747fc36de KTIJ-27434 [AA] Unwrap safe call expression when resolving implicit invoke calls
`FirSafeCallExpression` does not implement `FirResolvable`, so we need
to unwrap it to correctly resolve calls like `foo?.bar()` when `bar` is
a lambda with receiver parameter or a functional type property

^KTIJ-27434 Fixed
2023-10-20 13:27:31 +00:00
Igor Yakovlev 86fd889138 [K/Wasm] Bump nodejs version 2023-10-20 13:02:14 +00:00
Mikhail Glukhikh cebb6747e3 K2: drop unnecessary attributes when inferring declaration types
Related to KT-62578
2023-10-20 12:38:19 +00:00
Mikhail Glukhikh 90eaf5f70f K2: introduce val ConeAttribute.keepInInferredDeclarationType 2023-10-20 12:38:19 +00:00
Sergej Jaskiewicz f2bb988e68 [FIR/IR generator] Replace getTypeWithArguments with a property
The `notNull` of that method was never used.
2023-10-20 10:49:20 +00:00
Sergej Jaskiewicz de4e39906c [FIR/IR generator] Use TypeRef for working with types in fields
- Don't inherit `AbstractField` from `Importable`, because it really
  is not
- Remove the `arguments` and `nullable` properties from `AbstractField`.
  Both properties can be derived from the field's `typeRef`.
- Make `AbstractField`'s `typeRef` property of type
  `TypeRefWithNullability` instead of just `TypeRef`, because fields
  can always be nullable.
2023-10-20 10:49:20 +00:00
Sergej Jaskiewicz f30bf0e7e2 [FIR generator] Remove unused customType property from SimpleField 2023-10-20 10:49:20 +00:00
Pavel Kirpichenkov 770332152b [LL] Don't register Java components for built-ins of non-JVM modules
This is the cause for the 'missing dependency supertype: Serializable'
issue: symbols from built-ins will have the additional Serializable
supertype provided by FirJvmDeserializationExtension that shouldn't
be used for non-JVM. In regular modules it is correctly not added by
the non-JVM sessions, leading to difference in supertypes and the error.

KTIJ-27449
2023-10-20 10:35:13 +00:00
Nikolay Krasko bd49df9878 Update intellij platform 213.7172.25 -> 213.7172.53 2023-10-20 10:10:47 +00:00
Pavel Kunyavskiy cf230525c5 [Code Owners] Update CODEOWNERS file with the new common backend team 2023-10-20 09:43:59 +00:00
Dmitrii Gridin 0b45c6ce23 [FIR] FirScriptConfiguratorExtensionImpl: provide source for script parameters
We need this source to be able to find the parent declaration

^KT-62693 Fixed
2023-10-20 09:27:21 +00:00
Dmitrii Gridin 17ab005668 [Analysis API FIR] KtSymbolContainingDeclarationProvider: support script declarations
This commit also fixes a missing symbol for KtScriptInitializer
and some symbol pointers
Many tests marked as 'DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE'
due to KtFirFileSymbol#createPointer logic – the pointer can
be created only for PSI

^KT-61451
^KT-61887
^KT-62626 Fixed
^KT-62693
2023-10-20 09:27:21 +00:00
Dmitrii Gridin d689c1a38f [FIR] FirJavaFacade: fix contract violation from annotations
`isJavaDeprecatedAnnotation` can't be used here because it triggers
the resolution of an annotation ClassId

^KT-62705 Fixed
2023-10-20 09:24:43 +00:00
Alexander Udalov 931c2ce47a Reflection: fix calling suspend fun returning value class over primitive
#KT-47973 Fixed
2023-10-20 08:50:26 +00:00
strangepleasures 6a2cea8a8e [KAPT4] KT-62097 Keep import statements for unresolved annotation classes 2023-10-20 08:33:17 +00:00
Alexander Udalov 731a1dd98d FIR: remove unused copy of CONFLICTING_JVM_DECLARATIONS
It was added as a placeholder in f3c58a1df7 and was not used anywhere.
The used error is declared in `JvmBackendErrors` and is reported by the
backend.
2023-10-20 08:01:59 +00:00
Anton Lakotka 196f14823e [Gradle] Re-use existing nativeDistribution dir
Having a dedicated konan data dir is not working well on Windows
machine. Since invocation of kotlin compiler would make JVM
to load native-specific dlls and it would not be possible to clean them
up until they are unloaded.

^KT-61359 Verification Pending
2023-10-20 07:40:17 +00:00
Sergej Jaskiewicz 75b509c185 [FIR/IR generator] Share visitor-related properties between FIR & IR 2023-10-20 06:41:12 +00:00
Mads Ager bdfb3c3ac9 [Native] Move remaining usages for LLVMBuildLoad to LLVMBuildLoad2.
Step towards LLVM opaque pointers.
2023-10-20 06:07:41 +00:00
Mads Ager 5b9a4b289f [Native] Fix tailrec test.
tailrec is no longer allowed on open functions but this test is
still using it.
2023-10-20 06:07:41 +00:00
Mads Ager 72ddd4b78d [Native] Use LLVMBuildLoad2 instead of LLVMBuildLoad.
This is a first step in the move from typed to opaque pointers.
2023-10-20 06:07:40 +00:00
Alexander Shabalin e4b34857c0 [K/N] Fix FrameworkTest with compileOnlyTests. 2023-10-19 21:48:33 +00:00
Anastasia.Nekrasova 4f85cdbaed [K2] Disappeared COMPONENT_FUNCTION_MISSING
^KT-59941
2023-10-19 21:18:01 +00:00
Hung Nguyen fc408125c8 Fix MemoizedCallable in PropertiesBuildService
In commit 5ceebec, the MemoizedCallable instance was created inside the
Provider, which means that the MemoizedCallable is not reused the next
time the Provider is resolved. This was not the intended effect.

In this commit, we will create the MemoizedCallable instance up front so
that each time the Provider is resolved, it will reuse the same
MemoizedCallable and therefore avoid recomputing the value.

Test: Manually verified on the large project in KT-62496
^KT-62496 Fixed
2023-10-19 20:44:59 +00:00
Ilya Chernikov 268d058bbb Implement missing invoke resolution branch with context receivers
#KT-61937 fixed
Note: the current implementation only resolves for a single receiver
in each group. See KT-62712 and KT-62709 for the followup.
2023-10-19 19:39:31 +00:00
Evgeniy.Zhelenskiy b89d8a65a1 [Reflection] Fix parsing JVM function descriptors
#KT-60708
2023-10-19 19:09:31 +00:00
Artem Kobzar df14f044cd [K/JS] Remove unconditional cast to IrClass in KClass expression 2023-10-19 17:34:00 +00:00
Dmitrii Gridin 500de9f9bb [LL FIR] FirElementBuilder: avoid body resolution for type references inside 'where'
^KT-62691 Fixed
2023-10-19 16:24:32 +00:00