Commit Graph

107151 Commits

Author SHA1 Message Date
Artem Olkov 5fcdd4a9f6 KT-63748: Pack Swift Export Frontend into compiler plugin
Co-authored-by: Sergej Jaskiewicz <jaskiewiczs@icloud.com>


Merge-request: KT-MR-13351
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2023-12-13 10:40:38 +00:00
Marco Pennekamp ae5a053025 [LL] Disable modifiable PSI tests due to application sharing issues
^KT-63650
2023-12-13 10:29:11 +00:00
Sergej Jaskiewicz f844a86057 [utils] Introduce the bind function and use it throughout 2023-12-13 10:04:45 +00:00
Dmitriy Novozhilov 93563d7c80 [FIR] Report PROPERTY_AS_OPERATOR for all operator conventions
^KT-62347 Fixed
^KT-59715 Fixed
2023-12-13 09:27:14 +00:00
Dmitriy Novozhilov 92c75fb7ab [Test] Reproduce KT-59715 2023-12-13 09:27:14 +00:00
Yahor Berdnikau 63e7749cfe [Gradle] Update AGP versions 2023-12-13 09:08:05 +00:00
Yahor Berdnikau da7ceb162b [Gradle] Cleanup max Gradle versions in the tests
As we are running now by default with Gradle 8.2 release our IT tests -
specifying this version explicitly does not make sense.
2023-12-13 09:08:05 +00:00
Tomas Husak 91465d7110 [FIR] KT-59421 add checker context receiver property backing field 2023-12-13 07:12:11 +00:00
Vyacheslav Gerasimov 6c3b740a05 Build: Remove -xmx for main Gradle daemon
In some cases a lot of memory consumed during IDEA import. To avoid OOMs
when working with IDEA we should limit heap size only for CI builds.
2023-12-12 21:26:35 +00:00
Ilya Goncharov 1d692ce6d1 [Gradle, JS] Fix devServer usage in KotlinWebpackConfig
^KT-64260 fixed
2023-12-12 19:24:13 +00:00
Yair Morgenstern 88e35fafd9 [Wasm] Use final Wasm structs for types without subtypes
A version of PR https://github.com/JetBrains/kotlin/pull/5175
 contributed by Yair Morgenstern, modified by Slava Kuzmich

^KT-60505 Fixed
2023-12-12 19:05:57 +00:00
Svyatoslav Kuzmich 2b4d1b0fb1 [Wasm] Bump SpiderMonkey jsshell version
Experimental flags --wasm-function-references --wasm-gc are removed.
GC is enabled by default with final subtype support.
2023-12-12 19:05:57 +00:00
Leonid Startsev af23706a9a Do not allow writing metadata versions that are too high
because a format may be incorrect for future compilers

#KT-64230 Fixed
2023-12-12 18:16:56 +00:00
Alexander.Likhachev 0d4dfbcf0c [IC] Revert the paths hashing introduced in 5562c95155
`File.hashCode()` behavior is OS-dependent. This can lead to the loss of mapping between a path and its related data in PersistentHashMap — for instance, when a map generated on Microsoft Windows is used on macOS. Notably, this can occur even though both systems use case-insensitive filesystems by default. This commit returns the hashing based on OS-independent path strings
^KT-64016 Verification Pending
2023-12-12 17:34:11 +00:00
Yan Zhulanow 0944e8fc36 [Analysis API] Keep the collected 'FirTowerDataContext' mutable
'ContextCollector' is used for computing context of 'FirCodeFragment's.
Code fragments themselves might contain additional smart cast operations
that modify the context receiver stack.

^KT-63056 Fixed
2023-12-12 17:31:52 +00:00
Yahor Berdnikau 4a7f12a8eb [Gradle] Fix deprecation warnings in AndroidBaseSourceSetName
^KT-56904 In Progress
2023-12-12 16:58:58 +00:00
Dmitrii Gridin b458d69689 [Analysis API FIR] KtFirSymbolDeclarationOverridesProvider: unwrap fake overrides
We should unwrap substitution overrides as they sometimes cannot be
resolved on demand. We already have this in KDoc contract.
```kotlin
class MyClass {
    val prop = object : LazySchemeProcessor<Int, Int>() {
        override fun is<caret>SchemeFile(name: CharSequence) = name != "str"
    }
}

abstract class LazySchemeProcessor<SCHEME : Number, MUTABLE_SCHEME : SCHEME> {
    open fun isSchemeFile(name: CharSequence) = true
}
```
In this case, we will try to resolve fake override in the context of the
anonymous object, and it will fail because we cannot lazily resolve
local declarations as they are a part of the containing declarations
(KT-64243 for more details)

^KT-64108 Fixed
2023-12-12 16:13:10 +00:00
Dmitrii Gridin e033fe5ba1 [Analysis API FIR] more tests for KtSymbolDeclarationOverridesProvider
^KT-64108
2023-12-12 16:13:10 +00:00
Gleb Lukianets 64ebec7955 [Swift Export]: KT-63280: Package inflation
Merge-request: KT-MR-13331
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2023-12-12 16:05:22 +00:00
Artem Kobzar 0b1c4b836a [K/JS] Fix file extension inside the JS KGP to run tests with ES modules ^KT-63719 Fixed 2023-12-12 14:52:26 +00:00
Sebastian Sellmair 4c7ad7eeb5 [Gradle] Add IdeMultiplatformImportAction API
This API can be used to schedule actions/setup code that is only
relevant for IDE sync.

^KT-56440 Verification Pending
2023-12-12 14:52:04 +00:00
Sergej Jaskiewicz dada4a60bd [SIR] Use shorter parameter names for some elements in visitor methods 2023-12-12 14:27:57 +00:00
Sergej Jaskiewicz e8459793b7 [SIR] Use SirTransformerVoid for ForeignIntoSwiftFunctionTranslationPass 2023-12-12 14:27:57 +00:00
Sergej Jaskiewicz cab87eba21 [SIR, FIR generators] Add KDocs for visitor-related methods of elements 2023-12-12 14:27:57 +00:00
Sergej Jaskiewicz 1bed6a063f [SIR] Add SirTransformerVoid class
This is convenient for cases when the transformer has no context to pass
to each method
2023-12-12 14:27:57 +00:00
Sergej Jaskiewicz 1bc2ac2c87 [SIR] Use SirVisitorVoid i/o SirVisitor for SirAsSwiftSourcesPrinter 2023-12-12 14:27:57 +00:00
Sergej Jaskiewicz 80847b9ee2 [SIR generator] Add SirVisitorVoid class
This is convenient for cases when the visitor has no context to pass to
each method
2023-12-12 14:27:57 +00:00
Sergej Jaskiewicz 80c9eae409 [tree generators] Factor out common transformer printing logic 2023-12-12 14:27:57 +00:00
strangepleasures 9670de74f1 [AA] KT-61776 Use an implementation of library scope that is immune to Jar cache invalidations
Merge-request: KT-MR-13356
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2023-12-12 14:05:53 +00:00
Dmitriy Dolovov b5d8db0267 [test] Exclude "K1-only" from FIR IR text tests and "K2-only" from Classic IR text tests
^KT-60390
2023-12-12 13:57:48 +00:00
Dmitriy Dolovov 44d57c7751 [test] Add missing KMP IR text tests to "K1-only" and "K2-only" groups
^KT-60390
2023-12-12 13:57:48 +00:00
Dmitriy Dolovov 0b3d64719f [test] Split KMP IR text tests onto K1-only and K2-only groups
^KT-60390
2023-12-12 13:57:48 +00:00
Ivan Kylchik 79c300209e [K2] Avoid type check for Kotlin's property in ConstUtils
When we check Java field for constant initializer, we could
be asked to get and check the type of Kotlin's property that
is used in this Java field. But there is no guarantee that the type
resolve phase was finished and this type is available. So we just
check for `const` modifier and skip type check.

#KT-63752 Fixed
#KT-62558 Obsolete
#KT-61786 Declined
2023-12-12 13:54:32 +00:00
Ivan Kylchik 97ba3fe396 [K2] Revert changes done in KT-61786
Changes in this ticket remove type enhancement in java fields
for K2. But after KT-61920 fix, we can actually support it.
2023-12-12 13:54:31 +00:00
Mikhail Glukhikh 2680c8effd K2: allow/disallow coercion-to-unit for callable references more precisely
Before this commit, K2 always applied coercion-to-unit for
callable references if expected type was Unit, and actual non-Unit.
However, this may not work in case when actual return type is
a type parameter and it must be inferred into Unit.
In this commit we started to disallow coercion-to-unit
for references with synthetic outer call (~ top-level in K1)
AND a type parameter as a return type (both should be true to disallow).
This provides better K1 consistency,
while still keeping some broken K1 cases working in K2.

See also added comment in CallableReferenceResolution.kt.

#KT-62565 Fixed
2023-12-12 13:52:29 +00:00
Mikhail Glukhikh 25c0bd278e CallableReferencesCandidateFactory.kt: minor cleanup for better reading 2023-12-12 13:52:29 +00:00
Mikhail Glukhikh 37789cf7f5 K2: introduce unwrapFlexibleAndDefinitelyNotNull 2023-12-12 13:52:29 +00:00
Bogdan Mukvich b76452e15f Use deployVersion if present for artifacts-tests
^KTI-1476
2023-12-12 12:28:44 +00:00
Ilya Goncharov 2932f49f65 [JS] Use npx instead of yarn in kotlin-test-js-runner 2023-12-12 12:01:04 +00:00
Marco Pennekamp fa3da87401 [LL] Fix rest library symbol providers computing the wrong package sets
- See KT-63718 for a detailed description of the issue. This fix is a
  workaround (see KT-64236).
- It's worth mentioning that it's too expensive to compute package sets
  for "all libraries except one". Package sets are just an optimization.

^KT-63718 fixed
2023-12-12 12:00:41 +00:00
Troels Bjerre Lund f2cb0f1407 [K/N] Fix gep for local array header
This corrects the type given to GEP2 when initializing a stacklocal
array. This issue only cause problems when bitcode gets written before
any of the optimization passes, in which case it will fail on LLVM
validation when reading the bitcode back in on a subsequent pass.
2023-12-12 11:06:26 +00:00
Dmitrii Gridin fab51ff83c [Analysis API FIR] KtSymbolByFirBuilder: simplify call-site substitution override unwrap logic
Not we have separate SubstitutionOverride for declaration and call site,
so this logic can be simplified a lot
2023-12-12 10:46:24 +00:00
Bogdan Mukvich b7d56dea44 Point ArtifactsTests to custom maven repo dir to avoid stale artifacts
^KTI-1345
2023-12-12 10:28:48 +00:00
Ilya Chernikov d9f581c8b5 K2 Scripting: temporary mute test with LL divergence
#KT-64074
2023-12-12 09:58:19 +00:00
Ilya Chernikov db804b7f93 K2 Scripting: fix CFG processing related testdata in LL 2023-12-12 09:58:19 +00:00
Ilya Chernikov 90a7f7beac K2 Scripting: fix CFG processing related testdata in compiler 2023-12-12 09:58:19 +00:00
Ilya Chernikov ff4f30ddc1 FIR: replace receiver in anon initializer with containing decl
This way the abstraction represents the intended use better and
doesn't stay on the way of using FirAnonymousInitializer in scripts
2023-12-12 09:58:19 +00:00
Ilya Chernikov 12da3d2b9f K2 Scripting: add proper CFG processing for scripts
#KT-59683 fixed
#KT-63328 fixed
2023-12-12 09:58:19 +00:00
Ilya Chernikov a69eaa0ea3 K2 Scripting: fix testdata changed after script statements wrapping 2023-12-12 09:58:19 +00:00
Ilya Chernikov eeb723eb01 K2 Scripting: wrap script statements into blocks
(reuse anonymous initializers as block wrappers) so the top-level script
elements are all declarations now. Rename the property accordingly (
together with the previous commit).
It makes script more similar to the class and thus simplify e.g.
control flow analysis and resolve code.
2023-12-12 09:58:19 +00:00