Commit Graph

109571 Commits

Author SHA1 Message Date
eugene.levenetc 42d8db1c52 [ObjCExport] Fix suspend function and @Throws translations
KT-66115, KT-66239
2024-03-05 22:52:17 +00:00
Alexander Shabalin b7d1126861 [K/N] Remove outdated kotlin-backend-native-for-ide
Unused as of 0713866c1e
2024-03-05 21:47:43 +00:00
Alexander Shabalin d04e295e28 Update verificationMetadata 2024-03-05 21:47:43 +00:00
Alexander Shabalin e8202c3355 [K/N] Simplify dependencies around kotlin-native/ 2024-03-05 21:47:43 +00:00
Alexander Shabalin 24ede14e37 [K/N] Convert :kotlin-native:backend.native buildscript to kts
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin 0542b62430 [K/N] Extract :native:cli-native from kotlin-native/backend.native/cli.bc 2024-03-05 21:47:43 +00:00
Alexander Shabalin bce550dce4 [K/N] Move llvm interop generation to kotlin-native/llvmInterop/ 2024-03-05 21:47:43 +00:00
Alexander Shabalin ab62632a85 [K/N] Move files, env interop generation to kotlin-native/common/ 2024-03-05 21:47:43 +00:00
Alexander Shabalin 9f0a6537bb [K/N] Convert :kotlin-native:Interop:StubGenerator
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin d7bccaef42 [K/N] Convert :kotlin-native:Interop:Skia buildscript to kts
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin 3a5f33e9cd [K/N] Convert :kotlin-native:klib
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin ec8bc6a64f [K/N] Convert :kotlin-native:utilities:cli-runner buildscript to kts
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Mikhail Glukhikh e8ba534904 K1/K2: add tests confirming behavior of remaining KT-63242 cases 2024-03-05 20:19:02 +00:00
Sergej Jaskiewicz 0008e832d8 [PowerAssert] Improve the accuracy of locating infix operator tokens
Use KotlinLexer to determine the correct offset of an infix operator
token instead of skipping whitespaces after the operator's LHS.

This fixes cases like this:

```
assert("Name"/*in*/in/*in*/listOf("Hello", "World"))
              |            |
              |            [Hello, World]
              false
```
2024-03-05 18:54:06 +00:00
Sergej Jaskiewicz 54c58671fb [PowerAssert] Correctly align infix calls for built-in operators
Instead of searching for the operator in the string representation of
the whole expression, consider the operator's start to be the
first non-whitespace non-dot character _after_ the LHS of the infix
expression.

This fixes cases like this:
```
assert("Name in " in listOf("Hello", "World"))
             |       |
             |       [Hello, World]
             false
```

^KT-66208 Fixed
2024-03-05 18:54:06 +00:00
Sergej Jaskiewicz 7d22825176 [PowerAssert] Reproduce KT-66208 2024-03-05 18:54:06 +00:00
cristiangarcia 540df2944b XcodeValueSource needs to return a Serializable object
Required for KTI-1553
2024-03-05 18:52:33 +00:00
Kirill Rakhman b4413776ab [Raw FIR] Build if - else if - else as two nested whens
This is necessary for inference to work like in K1 because we only
add equality constraints from expected types on top-level `when`, not
on nested ones.

#KT-65882
2024-03-05 17:38:59 +00:00
Kirill Rakhman 888c1defa0 [FIR] Improve source selection for NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER 2024-03-05 17:38:59 +00:00
Kirill Rakhman c9d23f795a [FIR] Use named arguments in ConeBuiltinTypeUtils 2024-03-05 17:38:59 +00:00
Kirill Rakhman 69a7bf7f68 [FIR] Add equality constraint from expected type for some synthetic function calls
This fixes some cases where we infer some type variable inside one
of the branches to Nothing instead of the expected type because Nothing
appeared in some other branch.

Specifically, we add an equality instead of a subtype constraint during
completion of calls to synthetic functions for if/when, try and !!.
We don't do it when the call contains a (possibly nested) elvis or is
inside the RHS of an assignment.
Otherwise, we would prevent some smart-casts.

#KT-65882 Fixed
2024-03-05 17:38:59 +00:00
Kirill Rakhman eaef7122f6 [FIR] Update WithExpectedType.toString 2024-03-05 17:38:58 +00:00
Kirill Rakhman 0e7fc3bafe [FIR] Use correct origin for value and type parameters of synthetic functions 2024-03-05 17:38:57 +00:00
Igor Yakovlev c0f387dbd1 [Wasm] Implement IrLinkageError end enable partial linker
KT-58088
2024-03-05 17:17:32 +00:00
Vyacheslav Gerasimov 2e787c50be Build: Create GroupedByGradleVersion Gradle IT test tasks only on CI
All those tasks are displayed in the gutter when running a test making
it very long.
2024-03-05 17:12:31 +00:00
Vyacheslav Gerasimov 679e6f0504 Build: Use junit auto detection for DisabledIfNoArgumentsProvided
#KTI-1596
2024-03-05 17:12:31 +00:00
Vyacheslav Gerasimov 424a5055e2 Build: Group KGP Integration Tests by Gradle version
#KTI-1596

To avoid Gradle daemons pile up during test execution, run each Gradle
version in a separate task. Gradle daemon used for testing will be
terminated at the end of each execution preventing memory exhausting
in a low-memory environment (e.g., build agents).
2024-03-05 17:12:31 +00:00
Artem Kobzar 8d4948c3ee [K/Wasm] Generate .d.ts tests for K/Wasm in the same way as we do for K/JS ^KT-65778 Fixed 2024-03-05 15:33:56 +00:00
Nataliya.Valtman c2023142f5 Add validation for empty kotlin.build.report.json.directory property
#KT-66314: Fixed
2024-03-05 15:05:56 +00:00
Mikhail Glukhikh a77a1cf3db K1/K2: add test confirming correct work of KT-63487 case 2024-03-05 14:51:15 +00:00
Alexander Udalov 9a7d7483a3 IR: simplify IrFakeOverrideBuilder.isMoreSpecific
Using the logic from `OverridingUtil.isMoreSpecific` as a reference.
2024-03-05 14:48:23 +00:00
eugene.levenetc 5c64832c0f [ObjCExport] Fix extensions interface name
KT-66315
2024-03-05 13:38:36 +00:00
Timofey Solonin 2a445a04b0 Specify androidTarget's source sets graph in tests
^KT-65540
2024-03-05 13:38:00 +00:00
Timofey Solonin a8266eb20e Simplify set up of the resources variant in js and native targets
^KT-65540
2024-03-05 13:38:00 +00:00
Timofey Solonin 1895e480c5 Mark resources APIs in ExternalKotlinTarget with ComposeKotlinGradlePluginApi
^KT-65540
2024-03-05 13:38:00 +00:00
Timofey Solonin 9f6fb715dd Improve the creation of resolvable resources configuration
* Remove type casting for KotlinJsIrTarget
* Only create a resolvable configuration when the appropriate strategy
  is used

^KT-65540
2024-03-05 13:38:00 +00:00
Vladimir Sukharev 848cca03c0 [Tests] Add tests for KT-40180
^KT-40180 Fixed
2024-03-05 13:37:26 +00:00
Wojciech Litewka eec14f0054 [tree generator] Remove Suppress("unused") from implementation classes
Those only implement base classes, their members are not supposed
to be referenced directly (those sometimes they are).
So unused code in there can be suspicious.

On the other hand, some generated builders are truly unused, so leave
the suppression for them.
2024-03-05 13:06:03 +00:00
Timofey Solonin 737ad3cde6 Specify broken macros in legacy testing infrastructure
^KT-65542
2024-03-05 12:15:29 +00:00
Alexander Shabalin ce68a1a276 [K/N][tests] Remove native unit tests from old infra ^KTI-1571 2024-03-05 12:10:32 +00:00
cristiangarcia 57edc413a3 Make native tasks CC compatible
This allows running with CC&native:
./gradlew assemble
./gradlew :kotlin-native:bundle
./gradlew :native:native.tests:test

Required for KTI-1553
2024-03-05 11:22:20 +00:00
Mikhail Glukhikh 584d98cd72 K2: add a BB test confirming work of KT-63588 2024-03-05 11:09:51 +00:00
Alexander.Likhachev 9d88e90821 [BTA, Gradle] Share cached classloaders between builds
^KT-64353 Fixed
2024-03-05 10:51:10 +00:00
Ilya Goncharov 0ce7bdc837 [Gradle, Wasm] Fix compileSync input for production binary
^KT-66228 fixed
^KT-66159 fixed
2024-03-05 10:27:43 +00:00
Alexander Udalov 77b3f415a5 IR: fix "most specific" check in IrFakeOverrideBuilder
There were several problems with it:

1) `isMoreSpecific` should return true if a == b. Otherwise
   `isMoreSpecificThenAllOf` would never return true because it's always
   invoked with a collection that contains the candidate. K1 behaves
   similarly, `OverridingUtil.isMoreSpecific` returns true if a == b.
   So in fact, "more" should be understood as "not less" here.
2) `transitivelyMostSpecificMember` in `selectMostSpecificMember` was
   always equal to the first element, so `isMoreSpecific` was invoked
   with incorrect arguments.
3) At the end of `selectMostSpecificMember`, we selected the first
   candidate with the non-flexible return type, however only dynamic
   type was considered. We need to check `isFlexible` via type system
   instead.

 #KT-66120 Fixed
2024-03-05 09:19:38 +00:00
Dmitriy Novozhilov a08df1821f [FIR] Provide suppression from primary value parameter to property
`@Suppress` annotation has `VALUE_PARAMETER` target, so when a property
  in the primary constructor is annotated with `@Suppress` it sticks
  to the parameter. But the suppression should work for all diagnostics
  reported on the parameter **and** the property

^KT-66258 Fixed
2024-03-05 07:59:26 +00:00
Dmitriy Novozhilov 5e742884de [Test] Reproduce KT-66258 2024-03-05 07:59:26 +00:00
Kirill Rakhman 172df04c9b [FIR] Fix raw type nullability computation
Consider the nullability of the type arguments, not of the type.
This fixes a false positive ARGUMENT_TYPE_MISMATCH.

#KT-66294 Fixed
2024-03-05 07:45:01 +00:00
Dmitriy Novozhilov df878918ee [FIR] Optimize memory consumption of KtPsiSourceElement
There were two lazy properties in `KtPsiSourceElement`, which were
  rarely computed, which led to the fact that source element retained
  a lot of memory for those lazy delegates

^KT-66172 Fixed
2024-03-05 07:03:35 +00:00
Alexander Udalov 19cc7981dc Update test data for IR text tests 2024-03-05 06:59:11 +00:00