Commit Graph

107297 Commits

Author SHA1 Message Date
Vladimir Sukharev c09e8909d4 [K/N] Move cinterop tests from standalone to codegen/box
^KT-61259
2023-12-18 18:04:27 +00:00
Vladimir Sukharev 0b0ba3160f [K/N] Treat DEF files as regular test source, compiled with cinterop
^KT-61259
2023-12-18 18:04:27 +00:00
Artem Kobzar 2530cba82a [K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed 2023-12-18 17:13:07 +00:00
Alexander Shabalin 4d07fdf97e [K/N] Fix CallsChecker handling objc_msgSendSuper2. 2023-12-18 16:51:23 +00:00
Aleksandra.Arsenteva c6b32200df [Test] Add diagnostic tests for smartcast in K2
List of issues:
KT-28806, KT-7186, KT-22997, KT-1982, KT-22996, KT-54443, KT-37308, KT-37115, KT-4113, KT-25747, KT-24779
2023-12-18 13:08:33 +00:00
Dmitriy Dolovov 48072c822b [Gradle][MPP] Ensure there are no KLIBs discriminated by duplicated unique_name
^KT-63573
2023-12-18 13:03:40 +00:00
Dmitriy Dolovov 5ffbaa1621 [Gradle][MPP] Rename already existing tests for KLIB resolver 2023-12-18 13:03:40 +00:00
Dmitriy Dolovov b1093d8082 [KLIB Resolver] Don't discriminate KLIBs by duplicated unique_name in K2 metadata compiler
Use the same approach as in K1 metadata compiler: resolve each library
separately from others, don't attempt to resolve them all at once.

^KT-63573
2023-12-18 13:03:40 +00:00
Dmitriy Dolovov 1c285de55e [KLIB Resolver] Prettier KLIB resolver messages
- Make the messages that are reported by KLIB resolver prettier
- For those messages that affect the resolve process add
  prefix "KLIB resolver: "
- Don't log warning on duplicated libraries on the classpath. This
  does not make any sense.

^KT-63573
2023-12-18 13:03:40 +00:00
Dmitriy Dolovov 3ab35cd417 [KLIB Resolver] Don't log any messages in isKotlinLibrary(File) fun
This function is only used for probing if a library at the given
path exists. Any errors or warnings logged by this function could
only bring a user to a confusion. So, it's better to avoid any
logging here.

^KT-63573
2023-12-18 13:03:40 +00:00
Dmitriy Dolovov 46081f968d [KLIB Resolver] Report KLIB resolver issues as compiler messages
The reason of this change is to make messages (especially warnings)
that are reported by the KLIB resolver become visible to the end user.
This can be achieved to forwarding such messages to the appropriate
compiler's components such as
`org.jetbrains.kotlin.cli.common.messages.MessageCollector` and
`org.jetbrains.kotlin.ir.util.IrMessageLogger`.

Also: The default `DummyLogger` should be used as minimal as possible.
Because it just forwards messages to the standard output (console)
where they can remain unattended. When the compiler is executed
from the Gradle plugin such messages appear only in DEBUG Gradle's log.

^KT-63573
2023-12-18 13:03:40 +00:00
Dmitriy Dolovov 8430be39c9 [KLIB Resolver] Minor. Formatted 2023-12-18 13:03:40 +00:00
Igor Chevdar 69459b056e [IR] Correct handling of loops in liveness analysis
#KT-64139 Fixed
2023-12-18 12:55:51 +00:00
Igor Chevdar 7907231bf2 [box-tests] Added a reproducer for #KT-64139 2023-12-18 12:55:51 +00:00
Dmitriy Novozhilov 94c46d384a [FIR2IR] Properly calculate the type of delegated function call
```
interface A {
    fun <T> foo(): T
}

class B(val a: A) : A by A {
    generated fun <T'> foo(): T' {
        return a.foo() // <------
    }
}
```

There was a problem that type of generated delegated call used
  an unsubstituted type of the original delegated declaration, which led
  to a situation when (see example) type of call `a.foo()` was not `T'`
  but `T`, which led to incorrect IR and further exceptions on backend

^KT-64257 Fixed
^KT-64284 Obsolete
2023-12-18 12:45:28 +00:00
vladislav.grechko c48753900c Fix CallableId::isIterator: recognize primitive array iterators
^KT-60266: Fixed
2023-12-18 12:13:12 +00:00
Bogdan Mukvich 926af575f9 Native: calculate and publish bundle artifacts' checksums
* Fix native publication creation

^Related to KTI-1479
2023-12-18 11:59:16 +00:00
Yahor Berdnikau 71a0dacf81 [Gradle] Move from constructor KotlinNativeLink task configuration
This should fix ConcurrentModificationException on getting task names
while loading import models in parallel.

^KT-63554 Fixed
2023-12-18 11:29:28 +00:00
Vladimir Sukharev df2dcccbf7 [Tests] Removed moved tests from old testing
^KT-64256 Fixed
2023-12-18 11:15:15 +00:00
Vladimir Sukharev e15068c62f [K/N][Tests] Adjust moved codegen tests to new infra
^KT-61259
2023-12-18 11:15:15 +00:00
Vladimir Sukharev a5f3d5b737 [K/N][Tests] Move some codegen tests to new infra: annotations..coroutines
^KT-61259
2023-12-18 11:15:15 +00:00
Yahor Berdnikau a1d13f54cb [Gradle] Fix deprecated buildDir usage in KotlinNativeXCFramework.kt
^KT-62527 In Progress
2023-12-18 10:04:17 +00:00
Yahor Berdnikau 5558a87c81 [Gradle] Fix deprecated buildDir usage in KotlinNativeLibrary.kt
^KT-62527 In Progress
2023-12-18 10:04:17 +00:00
Yahor Berdnikau 84dbc7fbcf [Gradle] Fix deprecated buildDir usage in KotlinNativeFramework.kt
^KT-62527 In Progress
2023-12-18 10:04:17 +00:00
Yahor Berdnikau 5769b743a7 [Gradle] Fix deprecated buildDir usage in KotlinCocoapodsPlugin
^KT-62527 In Progress
2023-12-18 10:04:17 +00:00
Igor Chevdar d0acaa4024 [gradle] Use more fine grained directory for K/N incremental compilation
Otherwise, two or more link tasks being executed in parallel will use the same directory
for IC caches which might lead to races during compilation

 #KT-63471 Fixed
2023-12-18 09:56:09 +00:00
Anastasiia Spaseeva 212b8487ee Native: calculate and publish bundle artifacts' checksums
^Related to KTI-1479
2023-12-17 20:46:46 +00:00
Timofey Solonin 57c7a71cbf Run ObjCToKotlinSteppingInLLDBTest only on arm64 macOS
^KT-63598
2023-12-17 12:46:58 +00:00
Alexander.Likhachev aa20bcd522 [Gradle] Fix unused parameter warnings related to the legacy JS target
KT-64275
2023-12-16 15:08:38 +00:00
Alexander.Likhachev 1772620d16 [Gradle] Remove redundant suppression in KotlinJsProjectExtension 2023-12-16 15:08:37 +00:00
Alexander.Likhachev 96717c644d [Gradle] Suppress deprecation warning for KotlinCompilationToRunnableFiles usage
The actual usage was already under suppression; however, we don't have support for suppressing import statements (KT-30155)
We need to handle these suppressions within KT-58227 and KT-64273
2023-12-16 15:08:37 +00:00
Mikhail Glukhikh 7c53387fc4 K1/K2: add test confirming the behavior of KT-61694 case 2023-12-15 22:18:45 +00:00
Evgeniy.Zhelenskiy 20f74c22d7 [FIR] Support redeclaration diagnostics for different levels of destructured parameters
#KT-59875 #KT-59898
2023-12-15 21:00:01 +00:00
Troels Bjerre Lund 6161f44d91 Remove needsProfileLibrary argument
Second phase of removing LLVM coverage. This had to wait until after the
bootstrap advance.


Co-authored-by: Troels Lund <troels@google.com>


Merge-request: KOTLIN-MR-838
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-12-15 16:44:12 +00:00
Kirill Rakhman 242e16baea [FIR] Don't check class super type annotations for loops
Only do it for typealiases.

#KT-64059 Fixed
2023-12-15 16:39:50 +00:00
Kirill Rakhman 984493fe8b [Tests] Add regression test for #KT-62865 2023-12-15 16:25:46 +00:00
Kirill Rakhman eb0f4167b3 [FIR2IR] Remove obsolete TODO
#KT-62865
2023-12-15 16:25:46 +00:00
Andrey Yastrebov 0c5a925b6e KT-62745: update CocoaPodsPodspecIT tests 2023-12-15 15:38:51 +00:00
Andrey Yastrebov f4097db0c2 KT-62745: add missing BUILT_PRODUCTS_DIR test 2023-12-15 15:38:51 +00:00
Andrey Yastrebov 259a2f5ec0 KT-62745: Set 'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO' in CocoaPods integration 2023-12-15 15:38:51 +00:00
Andrey Yastrebov 1eb6ae4d21 KT-62745: Add shouldFailEmbedAndSignAppleFrameworkForXcodeWithUserScriptSandboxingEnabled test 2023-12-15 15:38:51 +00:00
Andrey Yastrebov 5982543867 KT-62745: Add sandboxing error message to embedAndSignAppleFrameworkForXcode task 2023-12-15 15:38:51 +00:00
Pavel Kunyavskiy f50fab65cc [IrActualizer] Update doc on how the actualization process works. 2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 7813bb35cf [FIR2IR] Provide remapped f/o symbols to declaration storage
After a generation of fake overrides some code may still to refer old
  symbols from declaration storage (like computation of overridden
  symbols for lazy functions), so we need to remap those symbols using
  information from IR f/o generator
2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 97cf62e291 [FIR2IR] Properly calculate overridden symbols for lazy declarations
This change affects only mode with IR f/o generator

The old way of overridden computation with fir2ir f/o generator relied
  on the fact that fir2ir generator creates IR for all f/o and fills
  its caches. But with IR f/o generator enabled, we don't call fir2ir
  generator, so some caches are missing. And for this mode it's enough
  to acquire the symbol using the original declaration symbol and the
  lookup tag of the corresponding supertype

Relates to KT-64202
2023-12-15 15:38:10 +00:00
Pavel Kunyavskiy dcd3f3b155 [FIR2IR] Replace fake override symbols with normal ones
Fir2Ir introduces temporary symbols to avoid creating
fake overrides themselves. Further pipeline is not ready to
these symbols. That's why we have introduced separate pass,
that replaces all this symbols with real fake override
symbols, after they are created.

^KT-63645
2023-12-15 15:38:10 +00:00
Pavel Kunyavskiy c485382e80 [FIR2IR] Rework actualization pipeline
There are a lot of restrictions between different parts of the pipeline.

1. Fake overrides can't be built before classes are actualized
2. Constants can't be evaluated before callables are actualized
3. Callables can't be actulaized before fake overrides are built
4. Checkers can't run before constants are evaluated

This commit reorders things to make all these restrictions happy.

^KT-63644
2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 9609ac6908 [FIR2IR] Generate fake-override symbols for properties
^KT-63644 Fixed
2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 1d2601ccae [FIR2IR] Generate fake-override symbols for functions
^KT-63644
2023-12-15 15:38:10 +00:00
Ivan Kylchik 46cb108a23 [K2] Forbid to use "get class" in the context of string concat and equality
#KT-63941 Fixed
2023-12-15 13:54:13 +00:00