Commit Graph

104993 Commits

Author SHA1 Message Date
Timofey Solonin e7dbb9c9a8 Return APIs hidden by __CCT_ENABLE_USER_SPACE
^KT-61369
2023-10-02 10:13:56 +00:00
Timofey Solonin 33a4958c4c Move CloudKit changes from a category to the type
^KT-61369
2023-10-02 10:13:56 +00:00
Timofey Solonin 94f86d6ef9 Update def files for Xcode 15
^KT-61369
2023-10-02 10:13:56 +00:00
Timofey Solonin 622dba2ad5 Update Xcode to 15 RC
^KT-61369
2023-10-02 10:13:56 +00:00
Timofey Solonin 5e1031d98f Adhoc codesign explicitly for arm64 tvos simulator
due to Xcode 15's new linker not codesigning. Without signing binaries
are not runnable on arm64 macOS.

^KT-62086
2023-10-02 09:52:44 +00:00
Alexander Udalov 5ff15f6847 CLI tests: fix incorrect order of replacing versions
The change 9de6df6104 caused tests `requireKotlinCompilerVersion{,K2}`
to fail once the compiler version was changed to 2.0.0-dev-*. The reason
is that when patch version is 0, compiler version is equal to the
language version (which is itself always equal to JvmMetadataVersion).
So if we're replacing JvmMetadataVersion first, we end up with
`$ABI_VERSION$-dev-...` in the output, which is incorrect.
2023-10-02 08:59:12 +00:00
Filipp Zhinkin e803977924 KT-58588 Optimize Sequence::flatten
Rewrite FlatteningSequence to use
the same optimization technique as AbstractIterator.
Didn't extend AbstractIterator as storing and reloading a value
from a field is slightly slower compared to the implemented approach.
2023-10-02 08:03:13 +00:00
Filipp Zhinkin 7ca506870a KT-58588 Optimize Sequence::distinct
Use integer constants instead of enum to track AbstractIterator's state:
- for switches with a few cases, integer constants are
faster as there's no need to load ordinal value from
enum and map it into tableswitch index;
- on JVM, JIT-compiler can optimize away state-tracking code if it uses
integer constants, but when it comes to enums and tableswitches,
it can't apply a same set of optimizations to it.
2023-10-02 08:03:13 +00:00
Artem Kobzar 1062ca9646 [K/JS] Add ingored test for KT-60785 fix until the rr/vgrechko/accidental-reification-2 will be merged 2023-09-28 15:15:04 +02:00
Artem Kobzar 857c07fa25 [K/JS] Fix corutines build for 1.9.20
This reverts commit f0d6471a8bcbdfc52ddc840a6383032ef86976d1.
2023-09-28 15:15:04 +02:00
Pavel Kunyavskiy 1a36a06a07 [IR] Drop unused inter-module dependency
^KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy 03914e353f [IR] Rename classes after refactoring
^KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy ed7e458828 [IR] Don't use linker fake override builder in Ir actualizer
Now, it uses fake override builder from in Fir2IrComponents.
It would also allow using it in lazy classes in the future.

^KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy 9fd057d7c3 [IR] Simplify usage of IrOverrideUtil
It had some copy-pasted code for counting current file on each use-site.
Now it's encapsulated in strategy.

KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy 2b8b6a2b21 [IR] Split FakeOverrideBuilder to two parts
Now there is separate class encapsulating logic about how to build
fakeOverrides and one encapsulating logic of which classes
do need building fake overrides.

This also allows to untie strange inheritance dependencies.

^KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy fcca73e900 [IR] Simplify IrOverridingUtil
Previously, it had some internal state that was saved between calls
and needed to be cleared.

This state was eliminated, which makes invariants clearer and using
easier.

^KT-61934
2023-09-24 11:58:16 +02:00
Alexander Korepanov 0f4c550ee0 [JS IR] Add JS BE diagnostic tests
Add tests for:
 - EXPORTING_JS_NAME_CLASH
 - EXPORTING_JS_NAME_CLASH_ES

^KT-61710
2023-09-23 19:49:17 +02:00
Alexander Korepanov 522952db1f [JS IR] Run diagnostics by IR before the klib serialization
Implement an infrastructure for checking IR before JS klib serialization.
Implement the EXPORTING_JS_NAME_CLASH and EXPORTING_JS_NAME_CLASH_ES checks.

^KT-61710 Fixed
2023-09-23 19:49:17 +02:00
Alexander Korepanov 13bd627bfa [Common tests] Use RootDiagnosticRendererFactory for checking messages
The patch allows checking all diagnostings with checkFullDiagnosticRender().
It is required for the JS BE diagnostic tests.
2023-09-23 19:48:51 +02:00
Alexander Korepanov a7458f18a9 [Common tests] Support RENDER_ALL_DIAGNOSTICS_FULL_TEXT in JS BE tests
Move the checkFullDiagnosticRender() function from
the JvmBackendDiagnosticsHandler class so it can be reused
in the JsBackendDiagnosticsHandler class.
2023-09-23 19:48:50 +02:00
Igor Yakovlev 758484a01f [Wasm] Fix generation optimised when expression with Nothing type
Fixed #KT-62147
2023-09-23 10:18:30 +02:00
Yan Zhulanow 624d35fefd Update test data for 'ContextCollector' after renderer changes
See also d98da87278 ([FIR] Render
dot-separated FQNs instead of slash-separated ones in diagnostics).
2023-09-23 07:01:04 +00:00
Dmitrii Krasnov 93fcee7532 [Gradle] Muted NativeDownloadAndPlatformLibsNonParallelIT on Windows. 2023-09-23 06:26:11 +00:00
Johan Bay 9399663b6e [K/N] Serialize full IdSignatures to caches
^KT-61642 Fixed
2023-09-22 22:30:25 +00:00
Johan Bay 64e601bea0 Extract IdSignature serializer from IrFileSerializer
^KT-61642
2023-09-22 22:30:25 +00:00
Johan Bay a041e51ff2 Rename IdSignatureSerializer to IdSignatureFactory
^KT-61642
2023-09-22 22:30:24 +00:00
Alejandro Serrano Mena b1551c67e0 KT-59504 [FIR] Check _ on destructuring declarations
Previously the checker was ignoring them, leading to missing diagnostics

^KT-59504 Fixed
2023-09-22 21:46:09 +00:00
Sergej Jaskiewicz 59129501cb [FIR/IR generator] Remove unused properties of Type 2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz 3a5e69d651 [FIR/IR generator] Inherit TypeRef from Importable
This is the first step to replace the usages of `Importable`
in the FIR generator with `TypeRef`.

This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz d86161bccb [FIR generator] Remove Type#firType property as it has no effect 2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz a995c522f7 [IR generator] Factor out TypeRef to common module
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz d5394db185 [FIR generator] Factor out AbstractElement to common module
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz 977e316489 [FIR generator] Factor out TypeArgument to common module
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-09-22 19:46:14 +00:00
Nikolay Krasko 46cbec7260 Remove kotlinx-collections-immutable-metadata from verification (KT-61766)
For some reason resolution have changed once again after version
switch to 2.0.0
2023-09-22 19:38:37 +00:00
Yan Zhulanow bd6d492b0c [LL API] Compile code fragment together with its context file
Recently, 'KtFirCompilerFacility' started to compile files from
dependent modules separately. Until recently, the code fragment was
in the same module as its context, so they naturally went in the same
compilation round. Now a separate 'KtCodeFragmentModule' is created,
so the code fragment case has to be handled explicitly.

This fixes the following groups of tests:
- FirIdeNormalAnalysisLibrarySourceModuleCompilerFacilityTestGenerated
- K2IdeK2CodeKotlinEvaluateExpressionTestGenerated (in IntelliJ)
2023-09-22 19:26:21 +00:00
Dmitrii Krasnov 3074b50e86 Migrated GeneralNativeIT to junit 5 and gradle TestKit 2023-09-22 18:21:46 +00:00
Ilya Kirillov 1ace71a907 [Analysis API] allow completion from non-physical files
Needed for injection

^KTIJ-21127
2023-09-22 17:42:51 +00:00
Vladimir Sukharev 690d18e541 [K/N, Test] Move test code "org.jetbrains.kotlin.konan" -> "org.jetbrains.kotlin.konan.test.*" 2023-09-22 17:27:09 +00:00
Roman Golyshev f5c33ad380 KT-62139 [AA] Remove withValidityAssertion from FE10 implementation of createContextDependentCopy
FIR implementation already does not have this check in
`createContextDependentCopy`, because it's called not
inside `analyze` call, but before it (see
`analyzeInDependedAnalysisSession`)

^KT-62139 Fixed
2023-09-22 14:19:04 +00:00
Kirill Rakhman fbf68a5bcc [FIR] Narrow down range of NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER
This uses the same approach as
INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION where we use a visitor
to find a call to a symbol that contains the type variable in question.

#KT-56140 Fixed
2023-09-22 13:49:59 +00:00
Yan Zhulanow 4690a430f4 [LL API] Fix smart-cast collection for special 'FirElement's
'DFANode' is not created for certain elements, such as types or
references. Before the change, only the target element itself was
queried for DFA, making the 'ContextCollector' return an empty map of
smart casts.

^KTIJ-26973 Fixed
2023-09-22 13:40:09 +00:00
Dmitriy Dolovov 6c1711c52a Bump Kotlin/Native version in KGP to 2.0.0-dev-3904 2023-09-22 12:51:02 +00:00
Mikhail Glukhikh ae19cd91bf K2: fix "private to this" determination logic in accordance with K1
#KT-61844 Fixed
2023-09-22 12:23:46 +00:00
Mikhail Glukhikh b9302869d5 K2: reproduce KT-61844 2023-09-22 12:23:46 +00:00
Yan Zhulanow 36df749697 [LL API] Invalidate code fragment sessions on PSI modifications
Code fragments depend not only on their context module, but also on
body of the context declaration.
2023-09-22 12:20:05 +00:00
Yan Zhulanow 1293eb0fab [LL API] Rename 'KtModuleKind' to 'KtModuleResolutionStrategy'
The word "kind" is ambiguous – users might assume the kind is somehow
related to 'KtSourceModule'/'KtScriptModule'.
2023-09-22 12:20:05 +00:00
Yan Zhulanow 0f33f82ffc [LL API] Fix reflective patching for field accesses
Implement the same behavior as in K1 evaluator. Also see
'IRFragmentCompilerCodegen#codegenFactory' in the IntelliJ project.

The commit fixes the following failing tests in the IntelliJ project:
- K2IdeK2CodeKotlinEvaluateExpressionTestGenerated$SingleBreakpoint$CompilingEvaluator$InaccessibleMembers.testPrivateAnnotationCompanionValue
- K2IdeK2CodeKotlinEvaluateExpressionTestGenerated$SingleBreakpoint$CompilingEvaluator$InaccessibleMembers.testSelfMembers
- K2IdeK2CodeKotlinEvaluateExpressionTestGenerated$SingleBreakpoint$CompilingEvaluator$InaccessibleMembers.testOuterMembers
- K2IdeK2CodeKotlinEvaluateExpressionTestGenerated$SingleBreakpoint$Uncategorized.testPrivateMember
- K2IdeK2CodeKotlinEvaluateExpressionTestGenerated$SingleBreakpoint$Uncategorized.testProperties
- K2IdeK2CodeKotlinEvaluateExpressionTestGenerated$SingleBreakpoint$Uncategorized.testPrivatePropertyWithExplicitDefaultGetter
- K2IdeK2CodeKotlinEvaluateExpressionTestGenerated$SingleBreakpoint$Uncategorized.testPrivateClass
2023-09-22 12:20:05 +00:00
Yan Zhulanow fa98945719 [LL API] Remove KtCodeFragment-targeted conflict resolver from libraries
Before, 'KtCodeFragment's were analyzed as a part of their context
session. Now, a separate session is created for each code fragment,
and the LLLibraryScopeAwareCallConflictResolverFactory registration
moved there.
2023-09-22 12:20:05 +00:00
Yan Zhulanow 715f7d1a35 [LL API] Analyze code fragment in a separate 'FirSession'
Before, `KtCodeFragment`/`FirCodeFragment` was analyzed as a part of
its context `KtModule`. This has the following complications:

- In non-source sessions, diagnostic reporting is globally disabled.
  For code fragments, however, checking the code before passing it to
  the backend is essential.

- Special treatment for call ambiguities in libraries
  (`LLLibraryScopeAwareCallConflictResolverFactory`) becomes complicated
  as the conflict resolver has to be applied to a library module.

- `KtCodeFragment`s usually have a shorter lifetime than their own
  context. Caching may potentially be implemented differently for them.

^KT-61783 Fixed
2023-09-22 12:20:05 +00:00
Yan Zhulanow b32c083346 [LL API] Remove leaves of 'LLFirResolvableResolveSession' 2023-09-22 12:20:05 +00:00