Commit Graph

98134 Commits

Author SHA1 Message Date
pyos 166ddd9ea9 FIR CFA: make node unionness a runtime property
Class exit node should only unify data flow if it is an anonymous
object, in which case it only has one control flow input. Coversely,
any other class exit node has normal merge semantics for its control
flow inputs, but it won't have any data flow inputs.
2023-01-26 13:12:11 +00:00
pyos 9f17b5de97 FIR CFA: add edges according to constructor delegation 2023-01-26 13:12:11 +00:00
Igor Chevdar 29b7a8e435 [K/N] Supported ..< operator for BCE optimization 2023-01-26 12:54:19 +00:00
Nikolay Krasko f87c5cf166 Minor: add bash language to dependency verification block 2023-01-26 13:34:37 +01:00
Victor Turansky c2232dc789 Copy button for repositories 2023-01-26 13:34:36 +01:00
Alexander Udalov 4b0d878873 Change KaptFlag.USE_JVM_IR default value to true
According to the comment on `Kapt3GradleSubplugin.BooleanOption` and the
change in a7b1bade85.

 #KT-53135
2023-01-26 12:07:19 +00:00
Alexander Udalov 574b9b76cd Add test checking that JVM_IR is enabled/disabled in kapt
#KT-53135
2023-01-26 12:07:19 +00:00
Ilya Chernikov 62f2a09d70 FIR: fix use-site file in supertypes resolution
manifested in the IC tests by a seemingly redundant lookup,
although theoretically may lead to more severe issues.
Also fixes lookup recording ignoring logic, since the old
one may break with the new us-site file calculation.
#KT-55195 fixed
2023-01-26 11:56:21 +00:00
Ilya Chernikov dcbcc8b684 minor: restoring proper functioning of non-LT tests 2023-01-26 11:56:21 +00:00
Stanislav Ruban 7e0f69b8de Introduce tweaks and wording changes related to LV2.0-specific CLI warnings
Fix merge conflict related to renaming of one of the tests

Regenerate tests affected by previous commit

Fix merge conflict related to renaming of one of the tests

Improve wording of the `-Xuse-k2 -language-version 1.*` CLI warning

Improve wording of LV2.0-specific CLI warnings some more

Fix output of one of the tests for -Xuse-k2 deprecation

Tweak wording of LV2.0-specific CLI warnings

* make it clear in every warning that -Xuse-k2 is deprecated
* add a reminder to remove -Xuse-k2 for `-Xuse-k2 -language-version 2.0`
* add both possibly wanted fixes for `-Xuse-k2 -language-version 1.*`

Remove deprecated -Xuse-k2 flag from one of the tests

Merge-request: KT-MR-8449
Merged-by: Stanislav Ruban <Stanislav.Ruban@jetbrains.com>
2023-01-26 11:55:03 +00:00
Kirill Rakhman f6c189be7b FIR: Handle visibility of public setter of protected synthetic property like in K1
K1 allows writing access to a public setter of a protected synthetic
property only if the call is inside a subclass. K2 previously allowed
that unconditionally. This changes brings the behavior in line with K1.

^KT-56050 Fixed
2023-01-26 11:33:30 +00:00
Vladimir Sukharev 1990883bdc [K2/N] KT-55464, KT-56091 Fix various klib annotations, including critical ones
Merge-request: KT-MR-8457
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-26 11:15:15 +00:00
Mikhail Zarechenskiy 53967a1822 Update and simplify readme section about working with Intellij 2023-01-26 10:39:59 +00:00
Sebastian Sellmair d9957335d3 [Gradle] Don't fail when psm is missing from a given included build
This basically restores behaviour as before changes related to
the configuration cache support

See:
https://github.com/JetBrains/kotlin/blob/35dacd6add18e031902765fd1386f9f8aad7e738/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/KotlinProjectStructureMetadata.kt#L427

^KT-56198 Verification Pending
2023-01-26 10:25:20 +00:00
Sebastian Sellmair 6fae581ffb [Gradle][Minor] IdeaKotlinClasspath: Improve .toString() readability
KT-56198
2023-01-26 10:25:20 +00:00
Sebastian Sellmair 2bda0c0c57 [Gradle] Implement test covering KT-56198 (composite: mpp-jvm to jvm) 2023-01-26 10:25:19 +00:00
pyos 8aa50e9446 FIR CFA: add edges from maybe-throwing statements to catch/finally 2023-01-26 09:50:24 +00:00
Alexander Udalov ef208d9eac Throw if kotlinx-metadata-jvm version in jvm-abi-gen is too low 2023-01-25 23:24:05 +01:00
Sebastian Sellmair 85473068c9 [Gradle][Minor] Improve readability of SourceSetVisibilityProvider 2023-01-25 20:07:52 +00:00
Artem Daugel-Dauge b1b744b863 [Gradle] Provide granular Gradle warnings suppression for CocoaPodsIT
^KT-56162 Fixed
2023-01-25 18:45:23 +00:00
Marco Pennekamp 2922f85a98 [AA] KTIJ-23563 Add reference resolve tests for working cases
- Type arguments in invalid calls/property accesses are resolved
  correctly in many cases, for which this commit adds test cases.
2023-01-25 16:40:46 +00:00
Ilya Goncharov 42ded7be09 [Gradle, JS] Disable optimization in webpack for karma tests
^KT-56192 fixed
2023-01-25 16:06:29 +00:00
Igor Chevdar 9d911247fa [K/N] Wrap continuation with ContinuationImpl on callable references
#KT-55869
2023-01-25 15:55:16 +00:00
Mikhail Zarechenskiy 4dd7481ac3 Set Kotlin 1.9 and Kotlin 2.0 as ready for preview
^KT-56165
 ^KTIJ-24398
2023-01-25 13:09:38 +00:00
Mikhail Glukhikh b867fd8c2f FIR2IR: set CATCH_PARAMETER origin for catch parameters 2023-01-25 12:31:35 +00:00
Mikhail Glukhikh f0a1d3e3b1 FIR2IR: generate modifiers in reference adapters as PSI2IR does
In particular, this commit makes isExternal, isExpect and isTailRec
always false for FIR2IR reference adapters

#KT-55461 Fixed
2023-01-25 12:31:34 +00:00
Mikhail Glukhikh ae4b8be16b FIR2IR: never generate empty when #KT-55459 Fixed
In details, this commit changes the following:
- it converts FIR when without branches to empty IR block without when
- it doesn't drop empty else branches in when anymore
2023-01-25 12:31:34 +00:00
Anna Kozlova b026678a34 [LL] retrieve fir from generated property of desugaring ++ operator
^ KTIJ-24385
Temp property to store receiver is generated for `a.b++` expression.
If this property's psi corresponds to receiver expr, then FirProperty
would be found by mapper if receiver is requested.
It works unexpectedly, because FirProperty is normally not expected by expression.
This change set fake sources for generated FirProperty, so it won't be found
by source psi
2023-01-25 11:03:29 +00:00
nataliya.valtman 3aade8ad95 Mark removed source file as deleted for compiler
#KT-55905 Fixed
2023-01-25 09:43:10 +00:00
Kirill Rakhman c1420794b4 FIR: add checker for local extension properties
^KT-56013 Fixed
2023-01-25 08:25:56 +00:00
Yan Zhulanow 9873fe84f2 [FE] Fix exception from the 'UnusedChecker' on a destructuring
^KT-55973 Fixed
2023-01-25 08:05:58 +00:00
Yan Zhulanow 84baee1ef1 [LL API] Fallback for designation path calculation for special cases
Currently, designation path requires all intermediate classes to be
regular named classes. This is not certainly possible, especially for
invalid cases such as:

---
class Foo {
    object {
        class Bar {
            fun foo() {} // What's the designation path for 'foo()'?
        }
    }
}
---

If there was a way to get a parent for a given FIR element, we could
just follow parents until the root FIR node (which would be a FirFile).
2023-01-25 08:04:42 +00:00
Yan Zhulanow e390d2aae3 [LL API] Use a file as a modification tracker for out-of source roots 2023-01-25 08:04:42 +00:00
Yan Zhulanow 9619c695b7 [LL API] Support nested type aliases in file-based declaration provider 2023-01-25 08:04:41 +00:00
Yan Zhulanow 14178a9771 [LL API] Execute 'findNearClass()' only for stdlib-like classes
'LLFirProvider'/'LLFirProviderHelper' do not normally search for classes
in the 'kotlin.' package. While it has a positive impact on performance,
as 'kotlin.' package is normally forbidden in arbitrary modules,
during designation path calculation we need to handle also invalid
cases.
2023-01-25 08:04:41 +00:00
Yan Zhulanow 12e86bdb0c [LL API] Simplify 'withSyntheticClasses()', forbid nested on-air blocks 2023-01-25 08:04:41 +00:00
Yan Zhulanow 5120da6b70 [LL API] Rename 'outside' testPrefix with 'out_of_src_roots' 2023-01-25 08:04:40 +00:00
Yan Zhulanow 6ff3eb1a8d [LL API] Replace 'isLibrarySession' with an inverted extension function 2023-01-25 08:04:40 +00:00
Yan Zhulanow f6f667c387 [LL API] Adjust services required by LLFirBuiltinsSessionFactory
As 'initialiseVirtualFileFinderServices()' that is run during
test initialization collects transitive dependencies, all of them
must be ready. However, 'KtNotUnderContentRootModuleForTest' has a
built-in dependency provided by 'LLFirBuiltinsSessionFactory'.
2023-01-25 08:04:40 +00:00
Yan Zhulanow f199671c4d [LL API] Make 'KtNotUnderContentRootModuleForTest' depend on built-ins 2023-01-25 08:04:39 +00:00
Yan Zhulanow 9bd1a24c13 [LL API] Add KDoc for 'KtNotUnderContentRootModule#file'. 2023-01-25 08:04:39 +00:00
Yan Zhulanow 562952080e [LL API] Add tests for 'FileBasedKotlinDeclarationProvider' 2023-01-25 08:04:39 +00:00
Yan Zhulanow 6ba3bcb6b2 [LL API] Support several class declarations with the same ClassId 2023-01-25 08:04:38 +00:00
Yan Zhulanow d442531987 [LL API] Use session of a callable container for designation computation
Synthetic callables might be created with a call-site session in which
the containing class might be not found.
2023-01-25 08:04:38 +00:00
Yan Zhulanow 4c22afd1f3 [LL API] Unify cache for 'not-under content root' modules
Before, 'FirSession's for not-under content root modules were stored in
a project-global service, which essentially means that even if one
creates a non-cached 'LLFirResolveSession', 'FirSession's for such
modules will be cached and reused later. Such exact behavior happened in
sealed class inheritor pre-analysis handler.
2023-01-25 08:04:38 +00:00
Yan Zhulanow 7fb6fab517 Minor, remove unused code in 'compilerPluginConfiguration.kt' 2023-01-25 08:04:37 +00:00
Yan Zhulanow 10d6583d87 [LL API] Add fallback for cases when a containing class cannot be found
In some cases, 'LLFirProvider' doesn't return the existing class, e.g.
when the class is inside the 'kotlin.' package but when the
'-Xallow-kotlin-package' flag is not passed.

This fixes the test 'DiagnosisCompilerTestFE10TestdataTestGenerated.
TestsWithStdLib.testInaccessibleInternalClass()'.'
2023-01-25 08:04:37 +00:00
Yan Zhulanow e5cbe79027 [LL API] Encapsulate on-air class provider logic in LLFirProvider
The old 'FirProviderInterceptor' is too invasive, ad-hoc, and only a
few places in the compiler are aware of it.

This fixes the test 'FirOnAirResolveTestGenerated#testOnAirTypesResolve'
which started failing after the designation path collection refactoring.
The newly appeared class existence check started to fail:

```
val declaration = firProvider.getFirClassifierByFqName(classId)
check(declaration != null)
```
2023-01-25 08:04:36 +00:00
Yan Zhulanow f1edbc1a14 [LL API] Add tests for 'out of content root' analysis mode 2023-01-25 08:04:36 +00:00
Yan Zhulanow e4c2902e81 [LL API] Minor, clean up FirLowLevelCompilerBasedTestConfigurator 2023-01-25 08:04:36 +00:00