Commit Graph

99170 Commits

Author SHA1 Message Date
Artem Vasilev f7dea5bd70 [FIR] Filter duplicates in KtSymbolDeclarationOverridesProvider's output
^KT-54430
2023-03-03 11:06:18 +00:00
Artem Vasilev cac612f967 [FIR] Use symbol's FirSession in KtFirSymbolDeclarationOverridesProvider
^KT-54430 Fixed
2023-03-03 11:06:18 +00:00
Artem Kobzar 4eb5af68f4 [K/JS] Add @deprecated commentary if @Deprecated annotation exists on a declaration.
^KT-56405 Fixed
2023-03-03 10:18:11 +00:00
Vladimir Sukharev 31a16ba72c [K2/N] KT-56579 Enable fixed test mpp_optional_expectation
Merge-request: KT-MR-9063
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-03 08:41:19 +00:00
aleksandrina-streltsova 1a10e0fdb6 [Analysis API] Render annotations of type parameters 2023-03-03 06:43:08 +00:00
Vladimir Sukharev 0c2e3d2d48 Rename K2 test tasks
Merge-request: KT-MR-9069
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-02 20:58:31 +00:00
Yahor Berdnikau 8f07a9cc61 Cleanup unused Kotlin daemon dependencies 2023-03-02 16:24:54 +01:00
Dmitrii Gridin 60a8bb9a73 move kotlin-build-common to common artifact instead of fe10
^KTIJ-24819
2023-03-02 14:16:03 +00:00
Dmitriy Novozhilov 8c6d4a6f4b [FIR] Create intersection overrides for fields in intersection type scope
^KT-56820 Fixed
2023-03-02 13:40:59 +00:00
Sergey.Shanshin 4e56079c59 [KxSerialization] Fix "SyntheticAccessorLowering should not attempt to modify other files"
Added additional check for generated serializer to use cached child serializers

Fixes #KT-56990

Merge-request: KT-MR-9057
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-03-02 13:34:48 +00:00
Steven Schäfer 669ac1ae30 Parcelize: Handle nullable sparse arrays
Fixes https://issuetracker.google.com/269956252
2023-03-02 12:47:17 +01:00
Kirill Rakhman 1f0e6321b0 [FIR2IR] Use companion as bound receiver if expected type requires it
A::foo is preferably resolved as an unbound reference to A.foo, however
if A.Companion is a subtype of A and the expected type has one fewer
parameter than the type of the unbound reference, generate a bound
reference with the companion as receiver.

^KT-56519 Fixed
2023-03-02 10:55:46 +00:00
Gleb Lukianets fc96eb6d8d [KN] CInterop: __attribute__((objc_direct)) support
Merge-request: KT-MR-8828
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2023-03-02 10:36:53 +00:00
Dmitriy Novozhilov ae07d0e9ce [FIR] Unwrap smartcast on dispatch receiver in CFA for class initialization
^KT-56863 Fixed
2023-03-02 10:32:07 +00:00
Nikolay Lunyak bb368bd191 KT-56687: Unify handling of EnumEntries.
`supportsEnumEntries` in `EnumCLassLowering` is not really
needed, but it was left just in case.
Both K1 and K2 ensure the feature is
enabled before they generate IR.

`supportsEnumEntries` is not enough, because the frontend will not
generate `entries` if `kotlin.enums.EnumEntries` is not available
(linking against an outdated stdlib is considered a valid use-case).

From the resolution point of view,
it's OK to resolve into `entries` while
the feature is off, because then K1 reports an error on the call site.

^KT-56687 Fixed
^KT-55614 Fixed
2023-03-02 10:23:38 +00:00
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00
Kirill Rakhman 3b9724d20e [FIR] Desugar increment/decrement in body resolve phase
The expression needs to be resolved first to determine if there is a
receiver that needs to be extracted to a temporary variable. Also, the
special case for prefix increment/decrement on local variable without
delegates requires resolution to check if the variable is local.

^KT-56771 Fixed
^KT-56659 Fixed
2023-03-02 10:19:57 +00:00
Kirill Rakhman 5ecf9cce25 [FIR] Don't resolve already resolved qualified access
^KT-30507 Fixed
2023-03-02 10:19:53 +00:00
Kirill Rakhman 9a328ec75b [FIR2IR] Apply implicit casts to blocks 2023-03-02 10:19:51 +00:00
Kirill Rakhman d8c1830b06 [FIR] Fix duplicate setting of return type ref in desugared assignment 2023-03-02 10:19:51 +00:00
Svyatoslav Scherbina 3904966e2c Native: fix error message for C union with nested struct with bitfields
tryRenderStructOrUnion can return null for a struct or union to indicate
that passing it by value to or from C is not supported (e.g. it has
bitfields).

It incorrectly handled the case when passing a nested struct or union by
value was unsupported -- instead of null, it returned incorrect struct
declaration.

As a result, when passing such a complex struct or union by value to or
from C, the backend generated C stubs with syntax errors, which resulted
into obscure compilation error ("unable to compile C bridge").

This commit fixes this case in tryRenderStructOrUnion function, and thus
makes the compilation error message more understandable.

^KT-55030
2023-03-02 09:00:11 +00:00
Kirill Rakhman d00513599b [FIR2IR] Expand typealias in callable reference receiver generation
^KT-56750 Fixed
2023-03-02 08:20:04 +00:00
Ilya Kirillov 3ec032212c [Analysis API] Ignore FirClassUseSiteMemberScope scopes in KtFirReferenceShortener
Those scopes always contain all nested classifiers,
while only some of them are available without
explicit import. There are other, more reliable
scopes (like FirNestedClassifierScopeWithSubstitution)
which are stricter about which classifiers
they recognise as valid

^KTIJ-24684 Fixed
^KTIJ-24662 Fixed
2023-03-01 22:38:11 +00:00
Ivan Kochurkin d783bbe5e9 [Tests] Do not throw assert in TestFiles.createTestFiles
This assert makes a test red even if it contains IGNORE_BACKEND directive
2023-03-01 22:10:11 +00:00
Ivan Kochurkin ee53c5780f [FIR] Extract K2 MPP test data to the separated directory 2023-03-01 22:10:11 +00:00
Ivan Kochurkin 5b2a1feaf0 [IR] Support of @OptionalExpectation in IrActualizer
^KT-56579 Fixed
2023-03-01 22:10:10 +00:00
Ivan Kochurkin c10bd1e3f0 [IR] Drop using expectDeclarationsRemovingPhase if FIR is enabled 2023-03-01 22:10:09 +00:00
Ivan Kochurkin 585343d646 [FIR] Remove SessionUtils because it's not used 2023-03-01 22:10:09 +00:00
Ivan Kochurkin 9d0e02658f [FIR] Support of ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION diagnostic 2023-03-01 22:10:09 +00:00
Ivan Kochurkin 3e33258f36 [FIR] Support of ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE diagnostic 2023-03-01 22:10:08 +00:00
Ivan Kochurkin cf1bd9837a [FIR] Support of ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE diagnostic 2023-03-01 22:10:08 +00:00
Ivan Kochurkin 8bf9d6c92f [FIR] Support of ACTUAL_TYPE_ALIAS_NOT_TO_CLASS diagnostic
^KT-56514 Fixed
2023-03-01 22:10:08 +00:00
Ivan Kochurkin c418a7a7bf [FIR] Support of ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS diagnostic
^KT-56522 Fixed
2023-03-01 22:10:07 +00:00
Ivan Kochurkin f1fef62f76 [FIR] Consider default values from expect function during serialization
It's not possible to unmute some tests for K2 because it causes testData structure changing

If change testData, NATIVE doesn't work even with `IGNORE_BACKEND`
2023-03-01 22:10:07 +00:00
Ivan Kochurkin d87619e06e [FIR & IR] Support of default values for arguments in expect functions
Add FirActualDeclarationChecker that checks expect/actual return types

^KT-56331 Fixed, ^KT-56334 Fixed
2023-03-01 22:10:07 +00:00
Ivan Kochurkin a54b56d74e [IR] Simplify ExpectActualCollector, remove nesting 2023-03-01 22:10:06 +00:00
Ilmir Usmanov 010c7acc3a JVM IR: Restore logic of finding line number for suspend lambda
Before c7bc439661 we did not throw
exception when we could not find line number for element. However,
on synthetic suspend lambdas we do not have line numbers.

If future, when we fix adapted callable references (see KT-55559)
there will be more of them.

 #KT-56910 Fixed
2023-03-01 21:54:27 +00:00
Anna Kozlova 3eddfeb8c9 [psi] make collection literal stub based
^ KT-57035
2023-03-01 16:57:27 +00:00
Anna Kozlova b913b528af [psi] make class literal stub based
^ KT-57033
2023-03-01 16:57:27 +00:00
Pavel Kargashinsky 6d7e17e60c [Gradle][Tests] Remove unnecessary arch -x86_64 usage for arm Mac 2023-03-01 16:32:03 +00:00
Pavel Kargashinsky f4d2283f87 [Gradle][Tests] Bump AGPVersion to 4.2.2 2023-03-01 16:32:02 +00:00
Sebastian Sellmair 7c3e242a64 [Gradle] Disable K2HierarchicalMppIT using Disabled instead of Ignore
^KT-56210 Verification Pending
2023-03-01 16:30:46 +00:00
Sebastian Sellmair d579ae7e79 [K/N] Bump kotlin-native version to "1.9.0-dev-2639"
^KT-56210 Verification Pending
2023-03-01 16:30:46 +00:00
Sebastian Sellmair ff9d4799aa [Gradle] KotlinCompilationK2MultiplatformConfigurator: Only configure when K2 is used
^KT-56210 Verification Pending
2023-03-01 16:30:45 +00:00
Sebastian Sellmair 896d1ce267 [Gradle] Rename K2CompileTask to K2MultiplatformCompilationTask
^KT-56210 Verification Pending
2023-03-01 16:30:45 +00:00
Sebastian Sellmair a30abcb00c [Gradle] Move KotlinCompilationK2MultiplatformConfigurator into 'DefaultKotlinCompilationPreConfigure'
^KT-56210 Verification Pending
2023-03-01 16:30:45 +00:00
Sebastian Sellmair b90207edb9 [Gradle] Rename -Xdepends-on to -Xfragment-refines and use ':' for -Xfragment-sources instead of ';'
^KT-56210 Verification Pending
2023-03-01 16:30:44 +00:00
Sebastian Sellmair a692de871b [Gradle] Rename KotlinNativeCompile.buildKotlinNativeKlibCompilerArgs to buildCompilerArgs
^KT-56210 Verification Pending
2023-03-01 16:30:44 +00:00
Sebastian Sellmair 015941b195 [Gradle] Ensure KotlinCompilationK2MultiplatformConfigurator does not force eager task evaluation
^KT-56210 Verification Pending
2023-03-01 16:30:44 +00:00
Sebastian Sellmair b51fa78559 [Gradle] Rename K2Compile to K2CompileTask and expose KotlinCommonCompilerOptions
^KT-56210 Verification Pending
2023-03-01 16:30:43 +00:00