Commit Graph

99303 Commits

Author SHA1 Message Date
Aleksei.Cherepanov 6471624d0c [Gradle] Disable usePreciseJavaTracking flag for K2
Historically flag was enabled for Gradle projects, but we don't have fir-based JavaTracker for the K2 compiler for now, so we need to use a fallback strategy.
Note: it was disabled for tests with K2
Note2: after adding a fir-based java classes tracker this value should be set to true (KT-57147)

#KT-56886 Fixed

Merge-request: KT-MR-9053
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-03-09 13:41:25 +00:00
Kirill Rakhman d7880eb12c [FIR] Refactor SpecificityComparisonWithNumerics 2023-03-09 13:00:54 +00:00
Kirill Rakhman fa432d7f0d [FIR] Prioritize double over float in overload resolution
#KT-57194 Fixed
2023-03-09 13:00:53 +00:00
Svyatoslav Kuzmich 525317962c [Wasm] Test js(code) with vararg parameter 2023-03-09 12:50:14 +00:00
Svyatoslav Kuzmich d5b958f744 [Wasm] Support default parameter values in functions with js(code) 2023-03-09 12:50:14 +00:00
Dmitriy Novozhilov d5e6102ed9 [FIR] Properly check is some setter function is applicable for synthetic property
^KT-56506 Fixed
2023-03-09 12:32:49 +00:00
Yahor Berdnikau ce39a02e0a Unify Kotlin daemon JVM arguments settings in Kotlin repo
Now 'kotlin-daemon-config' convention plugin should be added into
settings plugins to configure Kotlin daemon.
2023-03-09 10:16:05 +00:00
Yahor Berdnikau b9d19a864a Unify Kotlin daemon JVM arguments settings in Kotlin repo
Now 'kotlin-daemon-config' convention plugin should be added into
settings plugins to configure Kotlin daemon.
2023-03-09 10:16:05 +00:00
Yahor Berdnikau c080765905 Add missing file encoding setting to buildSrc properties 2023-03-09 10:16:04 +00:00
Nikolay Lunyak f39467b4ba [FIR] KT-57175: Expand typealiases in the annotation class checker
^KT-57175 Fixed
2023-03-09 09:44:09 +00:00
Nikolay Lunyak 5cbe699fc4 [FIR] KT-56876: Ensure inner type classifiers are resolved in contracts
^KT-56876 Fixed
2023-03-09 09:43:03 +00:00
Nikolay Lunyak c156dfe855 [FIR] KT-56877: Allow checking types of containing classes in contracts 2023-03-09 09:43:03 +00:00
Nikolay Lunyak c7a71fec17 [FIR] KT-56877: Allow referencing implicit receivers in class contracts 2023-03-09 09:43:02 +00:00
Nikolay Lunyak 409249267c [FIR] Ensure this@label doesn't work in K2 2023-03-09 09:43:02 +00:00
Nikita Bobko 62d2327ca3 Don't issue a warning about expect/actual in the same module for incompatible expect/actual pairs
^KT-57067 Fixed
Review: https://jetbrains.team/p/kt/reviews/9123
2023-03-09 09:30:29 +00:00
aleksandrina-streltsova 3d0bca5ca1 [Analysis API] Handle missed cases in PsiElement.getExpectedType()
^KTIJ-24256
2023-03-09 09:19:00 +00:00
Pavel Kirpichenkov 7dd438cb9e [MPP] KGP dependency resolution: JVM stdlib for JVM+Android source sets
KTIJ-24701
2023-03-09 09:10:42 +00:00
Pavel Kirpichenkov 0c33e89c02 Extract Kotlin stdlib Gradle module constants in dependency management
KTIJ-24701
2023-03-09 09:10:42 +00:00
Mikhail Glukhikh af78ef77b4 K2: don't accept reflective function kinds as possible lambda type
#KT-56954 Fixed
2023-03-09 08:52:46 +00:00
Mikhail Glukhikh 7a6ff5de34 K2: add test for KT-56954 2023-03-09 08:52:46 +00:00
Kirill Rakhman f946ddeb40 [FIR] Implement checks for contract not allowed
^KT-55423 Fixed
2023-03-09 08:32:02 +00:00
Kirill Rakhman b2fbf8bed5 [FIR] Fix callable reference adaptation for overrides without defaults
Provide the correct scope to the argument mapping so that default values
in overridden functions are considered.

^KT-56864 Fixed
2023-03-09 08:26:16 +00:00
Alexander Korepanov 9d352694af [JS IR Tests] FIR invalidation tests re-generation 2023-03-08 19:08:42 +01:00
Alexander Korepanov f82d3e63a2 [JS IR] Use a backing field initializer for js() code folding
During a translation of the code from js() call to statement list,
 the compiler folds the code string. For that it uses property bodies.
 However the bodies can not be loaded in an incremental rebuild.
 The patch uses the backing field initializers of constant properties.
 The initializers are always loaded.

^KT-57002 Fixed
2023-03-08 16:56:05 +00:00
Yan Zhulanow c91ef606f7 [LL API] Treat built-ins as a part of the standard library
Normally, compiled declaration searcher should look up declarations
only inside the session declarations. However, built-ins are treated
as a separate dependency, so '...WithoutDependencies()' functions
return only a part of declarations for the Kotlin standard library.

This commit effectively reverts changes in the previous change
(07fdbeca19).

This commit fixes the rest of failing compiletion tests:
- HighLevelJvmBasicCompletionTestGenerated
- HighLevelMultiFileJvmBasicCompletionTestGenerated
2023-03-08 16:28:13 +00:00
Kirill Rakhman 81f858a3c4 [FIR] Require not-null source in buildImplicitTypeRef
KT-56906
2023-03-08 16:20:26 +00:00
Kirill Rakhman 04d57eb2f9 [FIR] Use cached instance of FirImplicitTypeRefImpl
^KT-56906 Fixed
2023-03-08 16:20:25 +00:00
Alexander Udalov f91e1fa7fd Psi2Ir: make most declarations internal, remove unused
The main motivation is to avoid pollution in autocompletion in IDE, and
avoid clashes for some common names.

A lot of stuff was declared public seemingly by accident. It is only
used, and can only be meaningfully used, from within the psi2ir module.
2023-03-08 14:38:39 +00:00
Alexander Korepanov bd3eb81aee [JS FIR] Use FIR in JS IR invalidation tests
Related to KT-56740
2023-03-08 13:18:15 +00:00
vladislav.grechko 17e6099b53 Initialize 'source' property of FirCatch objects properly
^KT-56923: Fixed
^KT-56755: Fixed
2023-03-08 12:03:35 +00:00
Kirill Rakhman 83845fbab5 [FIR] Only add non-subsumed to overridden of intersection override
If an intersection override overrides members A.x, B.x and C.x and
B <: A, then A.x is subsumed by B.x, and we don't add it to the list of
overridden members. This fixes a false-positive MANY_IMPL_MEMBER_NOT_
IMPLEMENTED where an implementation is subsumed by an abstract override.

^KT-57092 Fixed
2023-03-08 11:01:56 +00:00
Kirill Rakhman 6afb1b7363 [FIR] Fix grammar in MANY_IMPL_MEMBER_NOT_IMPLEMENTED message 2023-03-08 11:01:56 +00:00
Ilya Chernikov 54218eb77d FIR LT: fix column calculation with crlf line endings
#KT-57117 fixed
also:
- refactor the position finder (mostly for testability)
- add testing of position finder to the testLightTreeReadLineEndings
- refactor the test for readability
- add mixed line ending scenario
2023-03-08 10:18:05 +00:00
Ilya Chernikov feca40071d K2, MPP: Fix parent lookup in mangler in MPP scenario
fixes compilation of the ListTest.kt in stdlib tests
#KT-57131 fixed
(bootstrap required to see the effect!)
2023-03-08 09:38:48 +00:00
Ilya Chernikov 1d72681e4e K2: Fix stdlib test use of assertEquals
fixes test compilation according to the workaround
described in #KT-56717
2023-03-08 09:38:48 +00:00
Ilya Chernikov 8a8b204e11 K2, stdlib tests: make unsigned conversions explicit
Allow using K2 to compile stdlib tests
related to #KT-56379
2023-03-08 09:38:47 +00:00
Ilya Chernikov edcde79c02 Build: use K2 for stdlib tests when enabled
enables testing of #KT-56379
2023-03-08 09:38:47 +00:00
Kirill Rakhman c4255cdb0f [FIR2IR] Fix adapted callable reference to nested class constructor
^KT-56829 Fixed
2023-03-08 08:36:52 +00:00
Kirill Rakhman e0baeb53db [FIR] Fix substituted synthetic property with overridden getter only
When building the original for a substitution override for a synthetic
property, use the initial setter as fallback when unsubstituting it
returns null. This can happen when a generic class overrides the getter
of a synthetic property of a non-generic class. Then the setter is never
substituted, therefore there is nothing to unsubstitute.

^KT-57168 Fixed
2023-03-08 08:35:02 +00:00
Ilya Chernikov b3d0a0a1c8 FIR LT: support labelled destructured declarations
add missing conversion in the LT to FIR converter
#KT-56759 fixed
2023-03-08 07:28:35 +00:00
Igor Chevdar 7f0a4ad737 [K/N][IR] Reworked saving inline function bodies for cross-file inlining
#KT-57053 Fixed
 #KT-57029 Fixed
2023-03-08 06:48:52 +00:00
Igor Chevdar 315d9089b0 [box-tests] Another version of reproducer for KT-56965 2023-03-08 06:48:52 +00:00
Igor Chevdar 99ec3215d9 [box-tests] Added a reproducer for KT-57053 2023-03-08 06:48:51 +00:00
Evgeniy.Zhelenskiy 88f293d4a9 [IR] Support reflection for MFVC
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-07 21:44:43 +00:00
Evgeniy.Zhelenskiy 1ff4906880 [IR] Fix NVargs Function lowering when working with MFVC
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-07 21:44:42 +00:00
Evgeniy.Zhelenskiy 394cd944b6 [IR] Add MFVC representation during serialization of FIR to IR
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-07 21:44:41 +00:00
Evgeniy.Zhelenskiy 5b868becf4 [IR] Hide regular class constructor with MFVC parameters
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-07 21:44:41 +00:00
Evgeniy.Zhelenskiy d358e63b0a [IR] Rename InlineClassAwareCaller.kt to ValueClassAwareCaller.kt
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-07 21:44:40 +00:00
Nikolay Lunyak 07fa86f6bc [FIR] KT-57085: Ignore the diagnostic case in @Suppress()
^KT-57085 Fixed
2023-03-07 20:28:02 +00:00
Ilya Gorbunov 3b97bfb426 Extract kotlinLanguageVersion to gradle.properties
Read it when building docs in order to keep
docs version filter/language analyzer version in sync with
the language version used to compile libraries.
2023-03-07 17:55:23 +00:00