Commit Graph

107756 Commits

Author SHA1 Message Date
Nikita Bobko e6860054ea [FIR] Cleanup: drop AMBIGUOUS_ACTUALS diagnostic from the frontend
Motivation: AMBIGUOUS_ACTUALS can't be reported on frontend (because it
requires expect to actual mapping, but the mapping is only available on
backend)

In scope of KT-59938
Review: https://jetbrains.team/p/kt/reviews/13760
2024-01-10 08:08:41 +00:00
Jinseong Jeon f1ce57f08f AA: handle PsiType conversion for recursive type parameter case (again)
^KT-64595 fixed
2024-01-10 04:04:20 +00:00
Roman Golyshev 93f1555322 KTIJ-28080 [AA] Move selection checking to ElementsToShortenCollector.findClassifierQualifierToShorten
This way, even if the whole qualifier is not selected, but some of its
parts are, the reference shortener will correctly find and shorten
those parts

^KTIJ-28080 Fixed
2024-01-09 20:07:38 +00:00
Roman Golyshev 3b448b284c KTIJ-28080 [AA] Refactor ElementsToShortenCollector.findClassifierElementsToShorten
Move unrolling the qualifiers into the function, add some simple KDoc
2024-01-09 20:07:38 +00:00
Stanislav Ruban 8f79d519b8 Add @NotNull to return type of KtTestUtil.getJdk21Home 2024-01-09 18:45:59 +00:00
Stanislav Ruban 8c2293ddcd Use JDK 21 in AdditionalBuiltInsMembersSignatureListsTest
^KT-58765
2024-01-09 18:45:59 +00:00
Stanislav Ruban 4ef830f9ee Regenerate tests after removing separate test configurations for JDK 21
^KT-58765

Now that JDK 21 was released as stable, we can remove separate test
configurations for testing the compiler with JDK 21 and reintegrate
the corresponding test data into standard test configurations.
2024-01-09 18:45:59 +00:00
Stanislav Ruban a5bae12915 Remove separate test configurations for JDK 21
^KT-58765

Now that JDK 21 was released as stable, we can remove separate test
configurations for testing the compiler with JDK 21 and reintegrate
the corresponding test data into standard test configurations.
2024-01-09 18:45:58 +00:00
Stanislav Ruban 13b3987aab Prepare test data for removal of separate test configurations for JDK 21
^KT-58765

Now that JDK 21 was released as stable, we can remove separate test
configurations for testing the compiler with JDK 21 and reintegrate
the corresponding test data into standard test configurations.
2024-01-09 18:45:58 +00:00
Aleksei.Glushko 8ed806ebe0 [K/N] Concurrent phase in GC mark (KT-58865)
+ Log Stop The World reasons

Merge-request: KT-MR-13759
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2024-01-09 18:34:36 +00:00
Denis.Zharkov f8fd46a5b8 K2: Rename delegateProvider in node for delegate and refine its type 2024-01-09 18:03:05 +00:00
Denis.Zharkov ca9372cfa0 K2: Get rid of using inference session for augmented assignments
Instead, use specific resolution mode handled by call completer.
Mostly, it's done for simplification of PCLA implementation because
otherwise we would need to track how PCLA inference session and the
one for augmented should be combined.

But just independently of this, not using inference session here,
it looks just simpler.

^KT-59791 In Progress
2024-01-09 18:03:05 +00:00
Denis.Zharkov 4e26c9f2ba K2: Fix updateSubstitutedMemberIfReceiverContainsTypeVariable
Initially, it was a bug caused by unfortunate copy-paste, but there were
no tests for this because mostly `delegation` operators are functions

But after PCLA is implemented, many tests start failing
For example, FirPsiOldFrontendDiagnosticsTestGenerated.Tests.BuilderInference.OneParameter.OneTypeVariable.OneTypeInfoOrigin.TypeInfoSinks.testImmutableProperties

^KT-59791 In Progress
2024-01-09 18:03:05 +00:00
Denis.Zharkov f831e11b4a Minor. Refine type parameters' naming in diagnostic test data
Using different names is more convenient for debugging
2024-01-09 18:03:05 +00:00
Denis.Zharkov d9f6e33cf7 Minor. Reformat FirCallCompleter.kt 2024-01-09 18:03:05 +00:00
Denis.Zharkov c163f86ecb Minor. Reformat some inference files 2024-01-09 18:03:05 +00:00
Denis.Zharkov 9a6bff958f K2: Drop unused methods from FirInferenceSession 2024-01-09 18:03:05 +00:00
Pavel Kunyavskiy 9374cacdd6 [IrActualizer] Don't actualize expect types
This was never semantically correct, but was not important
before KT-63644, as they were immediately dropped after that anyway.

After KT-63644, they were used to compute fake overrides inside them,
which were later matched against actual class, which can
produce false-positive matching errors.

^KT-64835
2024-01-09 17:53:06 +00:00
Nataliya.Valtman cf3672314a Remove JMX bean invocation for internal build FUS metrics
#KT-58768 In Progress
2024-01-09 16:48:11 +00:00
Alexander Udalov 9b5c331c8e IR, descriptors: remove (Ir)ExternalOverridabilityCondition.Result.CONFLICT
No existing external overridability condition reports a conflict anyway,
and there's no support for it in the IR case.
2024-01-09 16:19:14 +00:00
Alexander Udalov c63f31f92f Fir2Ir: minor, remove obsolete part of a TODO related to KT-61804
KT-61804 is obsolete, or at least shelved at this point.
2024-01-09 16:19:14 +00:00
Alexander Udalov 70cfd34a7b Tests: minor, change test mute reason to KT-64432 2024-01-09 16:19:14 +00:00
Dmitriy Novozhilov 4c74fa1d1d [Build] Exclude native tests of atomicfu from the JPS compilation
`AtomicfuNativeTestGenerated` test depends on classes from Native
  modules, which are not present in the JPS build. Which means that this
  class should be excluded from the compilation, so "Build project"
  wouldn't fail on it
2024-01-09 16:09:24 +00:00
Stanislav Ruban 78221bac11 Regenerate test configuration files with outdated copyright notices 2024-01-09 15:08:34 +00:00
Vladimir Sukharev 8f201a0257 [FIR] Refactor FirCallableDeclaration.getOverriddenSymbols
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev e166e70916 [FIR] Refactor FirRegularClassSymbol.getSuperClassSymbolOrAny
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev a78cfff8c9 [K/N] Move more names to NativeStandardInteropNames
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 324e04586a [K/N] Properly format new diagnostic messages texts
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 943306f8fe [K/N][Tests] Restore inline modifier in t59.kt test
^KT-61259
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 7eb239c282 [K/N][Tests] Move objCActionFqName to NativeStandardInteropNames
^KT-61259
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 28ee61c57d [K/N] Add diagnostic directives to test sources
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev dbba6d09ff [K/N] Implement FirNativeObjCOverrideInitChecker
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 4a97db82b3 [K/N] Fix local class handling for FirLightTreeNativeIrTextTestGenerated.FirProblems.testInnerClassInAnonymous
Reason: ClassId.toSymbol(session) cannot be used for local classes.

^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev c5aed2b094 [K/N] Implement FirNativeObjCOutletChecker and FirNativeObjCActionChecker
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 08bc0a6bd0 [K/N] Adjust moved special backend checks tests
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 8f12bf6cc8 [K/N] Move special backend checks test sources to diagnostic tests folder
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 3d0a91bf3c [K/N][tests] Ignore test redundant_safepoints.kt under linux_x64
^KT-64844
2024-01-09 13:42:18 +00:00
Dmitriy Dolovov dcf1c7e61d [KLIB] API 4 ABI: Fail with adequate errors on non-existing/malformed KLIBs
^KT-64395
2024-01-09 13:10:24 +00:00
Nikolay Lunyak dd85a81d45 [FIR] Add a minimized alternative for orOperatorWithConstant.kt
It was decided to leave this code as is, because supporting
it would probably require introducing Implication-statements,
but this is not a good-enough use-case for such work.
2024-01-09 10:47:14 +00:00
Nikolay Lunyak f52648af5f [FIR] Support CHECK_TYPE in K2 JS tests
^KT-60056
2024-01-09 10:47:13 +00:00
Nikolay Lunyak 69fba8d33b [FIR] Make captureFromTypeParameterUpperBoundIfNeeded smarter
Before this change `ARGUMENT_TYPE_MISMATCH` would complain that
`Y` "is not a subtype of" `Inv<Y>`, because the function would only
check immediate bounds of the type parameter `Y`. `chosenSupertype`
would be `X`, not `Inv<out kotlin/String>`.

^KT-60056
2024-01-09 10:47:13 +00:00
Nikolay Lunyak 5e1e8e8f61 [FIR] Highlight the weirdness of one test
The thing is, in a box test there is a proper
`UNRESOLVED_REFERENCE` on `M2().a.m2()` in K1 as well,
but it's not present in diagnostic tests. And also,
there's no error in the Kotlin IntelliJ plugin when
viewing such code.

It looks dangerous, but since this code is about
classes with identical fqNames, and since nothing
sus is really compiled, we can probably ignore this
problem. It's unlikely that it impacts much.
2024-01-09 10:47:13 +00:00
Nikolay Lunyak e4781d8508 [FIR] Fix FP UNRESOLVED_REFERENCE on implicit invoke() after a safe call
`invoke()` function of functional types is always defined
in such a way that its explicit receiver comes as the first
value parameter. Extension-function types contain the very
same `invoke` function, they just additionally have the
`@ExtensionFunctionType` annotation.

In the related test there is such an `invoke` function and
in the presented call its explicit receiver is the anonymous
function `fun Int.() = 1` itself. So the safe-checked `1`

^KT-60056
2024-01-09 10:47:13 +00:00
Nikolay Lunyak 502b422b6b [FIR] Ensure KT-62814 is not reproducible
^KT-62814 Obsolete
2024-01-09 10:44:35 +00:00
Igor Chevdar 8cc9272018 [K/N] Fixed a data race during monolithic caches creation
For per-file caches the data race is still there, but since per-file caches are
only used for incremental compilation, it's ok to leave it as is for now (we cope
with the data race by using a separate folder for each Gradle task).
2024-01-09 08:57:43 +00:00
Alexander Udalov d08c9ba222 JVM IR: transform fake override properties in SAM adapters
Replace every property with its getter and setter. This is needed
because later on, JVM backend assumes that all properties have been
lowered (by JvmPropertiesLowering) to this state.

 #KT-64116 Fixed
2024-01-08 21:31:13 +00:00
Ilya Kirillov d5b59c48c2 [Analysis API] fix "Cannot compute containing PSI for unknown source kind 'org.jetbrains.kotlin.KtFakeSourceElementKind$DefaultAccessor'" exception on getContainingSymbol call for default setter parameter
^KT-64825 fixed
2024-01-08 20:06:20 +00:00
Evgenii Mazhukin de4953adf6 [IC] Baseline fix for common sources getting access to platform declarations
K2-only issue. In an incremental build, sourceSet boundary isn't
preserved in certain conditions:

SourceSet A depends on SourceSet B
A and B overload a function, for example:

A -> fun foo(p: Parent) // (1)
B -> fun foo(c: Child) // (2)

If some source file in A is calling foo(..), only (1) is supposed to be visible
for that call site.

However, if

a) it is an incremental build,
b) the declaration of (1) is not a part of the compilation set, and
c) call to foo(c: Child) is applicable,

then (2) would be called from the generated code. So, the build result is not
consistent between the full build and an incremental build.

As a workaround, we fallback to a non-incremental build, if any source from A
needs to be compiled.

To enable "risky" incremental builds, use Gradle property
kotlin.internal.incremental.enableUnsafeOptimizationsForMultiplatform=true

^KT-62686
^KT-63837 Fixed


Merge-request: KT-MR-13695
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2024-01-08 20:03:08 +00:00
Yahor Berdnikau ad6513e247 [Gradle] Fix warnings in KotlinPluginWrapper
^KT-56904 In Progress
2024-01-08 19:18:32 +00:00
Sebastian Sellmair 198ebe9a39 [Code Owners] Make "Kotlin in Fleet" owner of objcexport-header-generator-analysis-api 2024-01-08 18:13:12 +00:00