Commit Graph

94554 Commits

Author SHA1 Message Date
Roman Golyshev bb2bee74cf [HL API] Fix FE10 implementation of KtExpressionTypeProvider 2022-09-01 13:57:03 +00:00
nataliya.valtman c047bc3647 Advance bootstrap to 1.8.0-dev-2628 2022-09-01 11:20:11 +00:00
Alexander Udalov 13ca189825 Support -Xjdk-release=8 as alias for -Xjdk-release=1.8
#KT-53278 Fixed
2022-09-01 12:15:47 +02:00
Alexander Udalov 19bbcc5869 Do not generate metadata for callable reference classes
After an accidental change in 846537b367, we started generating metadata
into anonymous classes for callable references. This metadata contained
the Kotlin representation of the referenced function. In KT-53794, this
led to a problem where Java's protected visibility could not be
represented in Kotlin terms, which crashed the backend.

But also, this metadata is useless because there's no real use case for
interpreting it (since you already have a function reference object at
runtime with all the needed information), so it would take some extra
space in the bytecode.

 #KT-53794 Fixed
2022-09-01 12:15:25 +02:00
Pavel Kirpichenkov 24dcad0d9c [MPP] Use module's type checker for upper bound checks
The default type checker doesn't have a correct type refinement setup.
This can cause false positives in subtyping of upper bounds in edge
cases with expect type arguments.

See the tests in the intellij repo.

KTIJ-22295
2022-09-01 09:51:11 +00:00
Svyatoslav Scherbina f8462f1b0c Native: allow virtual calls in CoroutineLaunchpad intrinsic
This intrinsic was always calling the supplied suspend function
non-virtually, and this was hardcoded in the intrinsic generator.
Now this can be configured with `superQualifierSymbol` in the respective
IrCall, just the way this works with any other calls.

As a side effect, global optimizations now process this intrinsic more
correctly (before that, they didn't take the intrinsic generator into
account, and treated the call as virtual).
2022-09-01 09:35:23 +00:00
Svyatoslav Scherbina 728fe918fe Native: don't expect that startCoroutineUninterceptedOrReturn receiver is FunctionN+1
Previous implementation of startCoroutineUninterceptedOrReturn expected
that the receiver (i.e. the suspend function object to start) of type
SuspendFunctionN (i.e. suspend function type with arity = N) is also an
instance of FunctionN+1 (i.e. regular function type with arity = N + 1)
with proper convention.

While compiler tries to achieve that (for better compatibility with
Kotlin/JVM, by generating additional supertypes and methods for classes
implementing suspend function types), this doesn't work e.g. for
implementations defined in Swift.

Fix this by adding fallbacks for cases when the receiver is not
a FunctionN+1, while keeping the fastpath for default FunctionN+1
cases.

^KT-51043 Fixed
2022-09-01 09:35:22 +00:00
Svyatoslav Scherbina 15fe2c2c5c Native: remove code duplication in coroutine intrinsics implementation
Make `createCoroutineUnintercepted` invoke
`startCoroutineUninterceptedOrReturn` when suspend function object is
not a `BaseContinuationImpl` (e.g. for a custom suspend function type
subclass), instead of using the copy of its implementation.
2022-09-01 09:35:22 +00:00
Svyatoslav Scherbina e64b057131 Native: make KonanTarget.supportsMimallocAllocator() exhaustive
To prevent forgetting adding a target there again.
2022-09-01 09:24:11 +00:00
Svyatoslav Scherbina 3f9da7263a Native: enable mimalloc by default on ios_simulator_arm64
This was probably forgotten when supporting Apple silicon.
2022-09-01 09:24:11 +00:00
Johan Bay f71931d04b [K/N] Parallelize marking in CMS GC
This change parallelizes marking by making each non-native Kotlin thread
mark its own view of the heap. To make this safe, we make flipping the
marking bit atomic which ensures that threads do not try to trace the
same objects.

Co-authored-by: Johan Bay <jobay@google.com>

Merge-request: KOTLIN-MR-423
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2022-09-01 09:07:54 +00:00
Alexander Shabalin 0734456a87 [K/N] Enable extra option for mimalloc ^KT-53182
Merge-request: KT-MR-6952
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-09-01 09:02:23 +00:00
Vladimir Sukharev 77ab69240e Do inline safepoints for watchos_arm64
Merge-request: KT-MR-6993
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-01 08:14:41 +00:00
Ilya Muradyan b801d963a1 [Scripting] Fix obtaining virtual file for getting compilation configuration 2022-08-31 20:51:06 +00:00
Alexander Udalov a76de14026 Remove obsolete compiler argument -Xsingle-module
#KT-51622
2022-08-31 20:54:50 +02:00
Alexander Udalov abaffeddab Remove LocalClassProtoTestGenerated, replace with kotlinp tests
This test uses a hacky mode of the compiler which is not worth it to
support further (especially in K2), `USE_SINGLE_MODULE`, where
everything is compiled in one module. The purpose of the test is just to
check that metadata for local/anonymous classes is written correctly.
So we can replace it with the tests on kotlinp, which uses
kotlinx-metadata-jvm and dumps all loaded metadata to text.

This replacement is not perfect, in particular because it won't check
that the reflection machinery is able to load this metadata, and because
it won't check that annotations are loaded correctly from the bytecode.
But IMHO it's good enough, there are box tests on reflection on local
classes (e.g. `reflection/annotations/localClassLiteral.kt`), so this
way is better than having to support the weird compiler mode for just
one test.
2022-08-31 20:54:50 +02:00
Svyatoslav Scherbina 7bf6d64cfb Native: move samples to backend.native/tests/ 2022-08-31 16:10:04 +00:00
Svyatoslav Scherbina b7337d2e64 Native: use samples only as compiler tests
Remove unrelated parts.
2022-08-31 16:10:04 +00:00
Svyatoslav Scherbina 71b8089f33 Native: remove samples that are not used in tests 2022-08-31 16:10:04 +00:00
nataliya.valtman d22cccdc4d Add property to protect sensitive data in http reports
#KT-53773 Fixed
2022-08-31 15:33:57 +00:00
Roman Golyshev 35116696b2 Add missing @Override annotation to KtParameter 2022-08-31 12:41:44 +00:00
Anton Lakotka 2e7a9f737f fixup! Update defFileProperty initialisation and remove empty method from test 2022-08-31 11:06:37 +00:00
Anton Lakotka 073d75179d [Gradle] CInterop Task input should be modifiable through Cinterop DSL
For configuration cache compatibility reasons Project object
was removed from DefaultCInteropSettings and instead
related factory services were used.

^KT-53704 Verification Pending
2022-08-31 11:06:37 +00:00
Anton Lakotka 45581c11fa [Gradle] Add test for KT-53704
CInterop Task input should be modifiable through Cinterop DSL
2022-08-31 11:06:37 +00:00
Denis.Zharkov 490382b77f Add test for KT-52782
It just demonstrates/fixate the current "broken" behavior in K1
that we unfortunately have and that is fixed in K2
2022-08-31 09:45:54 +00:00
Nikolay Krasko 01f567a16d Disable yarn and npm tasks from the build when tests are not active
Kotlin build shouldn't depend on npm during while deploy artefacts tasks

^KTI-887 Fixed
^KT-53687 Related
2022-08-30 22:15:16 +00:00
Denis.Zharkov db1bd4f232 Add test for KT-53124
The issue itself is supposed to be fixed after eb19d39cbf reverted

^KT-53124 Fixed
2022-08-30 15:56:31 +00:00
Denis.Zharkov 42c41a1916 Revert "[FE 1.0] Build captured type's supertypes in an alternative way: use own projection type as a first supertype, then supertypes from the corresponding type parameter's upper bounds"
This reverts commit eb19d39cbf.
2022-08-30 15:56:30 +00:00
Alexander Likhachev 2a53273f4d [Gradle] Add tests for KT-53686 2022-08-30 14:49:30 +00:00
Alexander Likhachev fa98430a67 [Gradle] Use valid XCFramework name in fat framework configuration
#KT-53686 Fixed
2022-08-30 14:49:30 +00:00
Alexander Likhachev 798f0efcf6 [Gradle] Prevent false positive warning about XCFramework names mismatch
#KT-53686
2022-08-30 14:49:29 +00:00
Alexander Likhachev 3836915012 [Gradle] Skip XCFramework task when there's no input frameworks
#KT-53686
2022-08-30 14:49:29 +00:00
Roman Golyshev 16cb3064c8 [FIR] Resolve value class constructor to TYPES before using its params
Right now it is the easiest way to ensure that all the parameters are
resolved. After KT-53573 is fixed, we might use `resolvedReturnTypeRef`
on each parameter individually instead

Also, add `toString` implementation to `ValueClassRepresentation`
classes, so they are properly rendered in testdata

^KTIJ-22630 Fixed
2022-08-30 13:49:40 +00:00
Sergej Jaskiewicz 17f22c7204 [JS IR] Use a special executor for stepping tests
This will hopefully fix flakiness for some tests
2022-08-30 13:38:47 +00:00
Ilya Goncharov 6ebbe12d44 Update yarn.lock to fix dependabot alerts 2022-08-30 11:39:27 +00:00
Denis.Zharkov f4a3ab877f Add test for parsing issue KT-53719
^KT-53719 Related
2022-08-30 11:21:51 +00:00
Denis.Zharkov 3d7969ec8f Revert "KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing"
This reverts commit 2053363def.

^KT-35811 Open
2022-08-30 11:21:50 +00:00
Denis.Zharkov 211d662708 Revert "KT-8263: Conditional operators are not parsed correctly"
This reverts commit ec8da2033c.

For the reason for the revert see KT-53719

^KT-8263 Open
^KT-53719 Fixed
2022-08-30 11:21:50 +00:00
Simon Ogorodnik 154e53c701 K1: add diagnostic BUILDER_INFERENCE_STUB_RECEIVER
It's reported on receivers in extension function calls with stub type,
as such calls can shadow members of finalized stub types causing
change of resolve when corresponding type argument specified explicitly

It works by checking extension receiver during call resolution parts run
That way we can easily detect if we found an extension applicable to
stub receiver and report call diagnostic for it

KT-53739
2022-08-30 10:19:26 +00:00
Simon Ogorodnik 105358dcf6 K1: add diagnostic BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION
Let's call builder lambdas (BL) a lambda that has non-fixed input type
projection at the moment of lambda arguments analysis, such lambdas
is a subject to be analyzed with builder inference
Due to bug in constraint system joining algorithm, currently system
of two or more such lambdas may lead to unsound type inference

Diagnostic added here should be reported in case when there are two
BL that shares a common constraint system, while not annotated with
@BuilderInference, as a protection against aforementioned bug

It's reported by ConstraintSystemCompleter when such situation has
occurred during builder inference phase, it is the same place that
decides wherever lambdas is subject to builder inference or not

KT-53740
2022-08-30 10:19:25 +00:00
Simon Ogorodnik db0d8d9f57 Add language feature for diagnostics in builder inference restriction 2022-08-30 10:19:25 +00:00
Simon Ogorodnik 4227fd012f Fix test for two builder inference lambdas 2022-08-30 10:19:24 +00:00
Mikhail Glukhikh f6ad6fb816 Add test for stub type receiver and for KT-53639 2022-08-30 10:19:24 +00:00
Mikhail Glukhikh 5cbecd276c FE: add test reproducing builder inference problem from KT-53422 2022-08-30 10:19:23 +00:00
Dmitriy Dolovov 444cdaa2d8 [Native][tests] Re-enable internalFromFriendModule codegen box test
^KT-53723

This reverts commit 6594ebe487f0758e0fab880e2902d3d28eca7f44.
2022-08-30 07:56:18 +00:00
Dmitriy Dolovov 6b6bc7d6fe [Native][tests] Fix: Pass friend modules to compiler CLI when building static cache
^KT-53723
2022-08-30 07:56:17 +00:00
Igor Chevdar ea4a841056 [box-tests] Ignored a test for K/N for now
The test checks internal declarations visibility from friend module,
the K/N test system is broken for now if uses caches
2022-08-30 07:29:07 +00:00
Igor Chevdar ced974fcb7 [IR] Fixed non-friend module visibility for LazyIR caches
K/N builds Lazy IR for cached libraries - so no IrModule for them,
have to use descriptors to find the module's name for the friend module predicate
2022-08-30 07:29:07 +00:00
Ilya Gorbunov 8b95257143 Reduce the chance shuffle produces an identical permutation in test (part 2) 2022-08-29 22:14:24 +02:00
Nikolay Krasko cfc013137e Fix compile error
Introduced in 43ce805499
2022-08-29 21:58:57 +02:00