Commit Graph

107737 Commits

Author SHA1 Message Date
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
Sergej Jaskiewicz 4f53204a31 [K/N] Set linkViaSignatures to false
This is already the case for Kotlin/JS.

This is required for fixing KT-63670: `linkViaSignatures` implies that
`SymbolTable` is used in FIR2IR, and in case if two declarations
have the same `IdSignature`, we have a crash in FIR2IR:

exception: java.lang.IllegalStateException: IR declaration with
signature "/foo|foo(){}[0]" found in SymbolTable and not found in
declaration storage

If we're not using SymbolTable, FIR2IR finishes successfully, and we can
safely proceed to the KLIB serialization stage, at which point we
can show the user a diagnostic about clashing signatures.

Since we've disabled SymbolTable, we also needed to fix the logic that
relied on its presence. Fortunately, such logic only includes
filtering out unused libraries. Instead of iterating over symbols in
SymbolTable, we iterate over cached symbols in Fir2IrDeclarationStorage
and Fir2IrClassifierStorage, which seems to do the trick just as well.
2024-01-08 17:17:47 +00:00
Sergej Jaskiewicz 766876b8a2 [K/N] Don't run ManglerChecker in K2 since its checks are disabled
KT-60648 is closed as "Declined", thus this code is not needed anymore.
2024-01-08 17:17:47 +00:00
Mikhail Glukhikh c2d031254c K2/MPP: add test confirming proper work of KT-62024
#KT-62024 Obsolete
2024-01-08 17:16:22 +00:00
Kirill Rakhman 50bfd19959 [FIR] Remove usage of FirSamResolver in call conflict resolution
#KT-63703 Fixed
2024-01-08 15:31:08 +00:00
Sebastian Sellmair ad8d4051b8 [ObjCExport] Fix tests with missing 'MustBeDocumented' annotations missing
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 7dbd5cd57f [ObjCExport] Implement 'test - dispatchAndExtensionReceiverWithMustBeDocumentedAnnotation'
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 90632ad746 [ObjCExport] Implement isObjCObjectType util
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair e0383282b5 [ObjCExport] Implement isObjCBaseCallable util
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair b5bcfaa2e3 [ObjCExport] translateToObjCProtocol: Support building members
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 47273a3d58 [ObjCExport] Move MethodBridge to shared module (2/2)
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 8f7e409bd7 [ObjCExport] Move MethodBridge to shared module (1/2)
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair b78f185299 [ObjCExport] Remove unnecessary instances in favor of static methods
All state will later be stored inside the KtObjCExportSession

KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 2f759243ba [ObjCExport] Implement isVisibleInObjC util
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 66533141b8 [ObjCExport] Implement getSuperClassSymbolNotAny util
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 9909940b24 [ObjCExport] Implement rudimentary interface to ObjCProtocol translation
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair aa3fa9e8c5 [ObjCExport] Implement 'findKdocString' utility for Analysis Api
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 72f135396c [ObjCExport] Extract generation of ObjC base declarations into shared code
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair aab9a606ce [ObjCExport] Split ObjCExportHeaderGenerator and ObjCExportTranslator
KT-64226
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 74c39b149f [ObjCExport] ObjCExportLazy: Get 'comment' from 'realStub' 2024-01-08 15:25:19 +00:00