Commit Graph

107706 Commits

Author SHA1 Message Date
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
Sebastian Sellmair 1cb60a53d9 [ObjCExport] Cleanup misleading test name for 'functionWithMustBeDocumentedAnnotation' 2024-01-08 15:25:19 +00:00
Sebastian Sellmair 7944a3dc4b [ObjCExport] Document 'ObjCExportStubOrigin' factory special case 2024-01-08 15:25:19 +00:00
Sebastian Sellmair 7ef62d1779 [ObjCExport] KtResolvedObjCNameAnnotation: Return null if ObjCName annotation is absent 2024-01-08 15:25:19 +00:00
Sebastian Sellmair 98fda13523 [ObjCExport] Extract header generation to shared module
^KT-64227 Fixed
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 1440e66519 [ObjCExport] Fix 'MustBeDocumented' annotation missing on non value parameters 2024-01-08 15:25:19 +00:00
Sebastian Sellmair 885a7dcd8f [ObjCExport] Implement test - kdocWithBlockTags
FL-23390
2024-01-08 15:25:19 +00:00
Sebastian Sellmair e409c60780 [ObjCExport] Split ObjCExport into K1 and Analysis Api implementation
FL-23390
^KT-64168 Fixed
2024-01-08 15:25:19 +00:00
Sebastian Sellmair 3e57265fcb [ObjCExport] ObjCExportStub: Do not retain reference to descriptor
FL-23390
^KT-64076 Fixed
2024-01-08 15:25:19 +00:00
Sebastian Sellmair e97463afb3 [ObjCExport][Minor] Reformat Code after move into newly created modules
FL-23390
2024-01-08 15:25:19 +00:00
Yahor Berdnikau 5fba2962b9 [Gradle] Add deprecated accessor to sourceSets inside KotlinSourceSet
Apparently, using such an approach is a popular case especially for
configuring 'dependsOn' parameter. And we should simplify user migration
 to more restricted DSL.

^KT-64722 Verification Pending
2024-01-08 14:07:50 +00:00
Yahor Berdnikau eb663117c7 [Gradle] Add dsl marker to KotlinSourceSet
We also need users to distinguish KotlinSourceSet DSL from other levels
of DSL, specifically extension one.

^KT-64722 In Progress
2024-01-08 14:07:50 +00:00
Dmitriy Dolovov e92017f64e [KLIB Resolver] Deprecate Logger.fatal()
Invocation of Logger.fatal() may cause severe side effects such as
throwing an exception or even terminating the current JVM process
(check various implementations of this function for details).

The code that uses Logger.fatal() sometimes expects a particular kind
of side effect. This is totally a design flaw. And it's definitely not
a responsibility of Logger to influence the execution flow of
the program.
2024-01-08 13:26:24 +00:00
Dmitrii Gridin 50dd94502b [SLC] fix PsiJavaCodeReferenceElement contract violation
We should provide valid getReferenceName as it is used
in many places (e.g. from com.intellij.psi.impl.PsiImplUtil.findAnnotation)

^KT-61605 Fixed
^KT-64605 Fixed
2024-01-08 13:22:56 +00:00
Alexander Korepanov b33798d65a [FIR2IR] Set proper offsets for generated data class members
^KT-64435 Fixed
2024-01-08 12:38:37 +00:00
Alexander Korepanov 6556acabba [JS FIR] Enable FIR JS stepping tests
^KT-64422 Fixed
2024-01-08 12:38:37 +00:00
Dmitrii Krasnov 36e8f9e3ac [Gradle Native] Provided default value for produceUnpackedKlib
^KT-64573 Fixed
2024-01-08 12:24:23 +00:00
Denis.Zharkov cb5070e335 NI: Add TODO for removing ALL_CONSTRAINTS_TRIVIAL_OR_NON_PROPER
^KT-63032 Related
2024-01-08 11:26:31 +00:00
Denis.Zharkov 90fcf086bb NI: Clean things around hasOnlyTrivialProperConstraint
- Get rid of unused val and its initialization
- Use a bit clearer naming
- Simplify the definition of `allConstraintsTrivialOrNonProper`
2024-01-08 11:26:30 +00:00
Anna Kozlova ce0a41fc69 [psi] move frontend independent string manipulators to psi.main module
this way IDE can drop dependency to old frontend,
when it's actually redundant
2024-01-08 09:54:48 +00:00
Vladimir Sukharev 35e5b0613d [K/N] Migrate filecheck test redundant_safepoints to new infra
^KT-62157
2024-01-08 08:59:24 +00:00
Vladimir Sukharev 35b83a1225 [K/N][FIR] Do not emit CAST_NEVER_SUCCEEDS when casting to forward declarations
^KT-61841 Fixed
2024-01-08 08:57:42 +00:00
Mikhail Glukhikh 050d74a22e FE: fix PlainJavaClassifierType.isRaw (take inner classes into account)
#KT-64090 Fixed
2024-01-08 08:33:03 +00:00
Mikhail Glukhikh d5b784805b K2: add tests for KT-58579 and for KT-64090 reproduction 2024-01-08 08:33:03 +00:00
Pavel Kunyavskiy f45d92eebc [K/N, K/JS, K/WASM] Enable FakeOverrideRebuilder by default
While not beeing final solution, this is closer to what
we want to have in the end. Enabling on non-JVM targets
would help better testing.

Enabling in JVM is now not possible yet, as some of the bugs are
not fixed yet (check KT-61360 for details)

^KT-62476
2024-01-08 07:46:07 +00:00
Pavel Kunyavskiy c6e32571d6 [FakeOverrideBuilder] Workaround KT-64743
Because of KT-64743 there is unexpanded type-alias in a place we don't
expect it to occur. To workaround this, we just expand typialiases in
one more place.

^KT-64743
2024-01-08 07:46:07 +00:00
Pavel Kunyavskiy c0f0c595c3 [IR Actualizer] Don't crash on incorrect code 2024-01-08 07:46:07 +00:00
Yan Zhulanow e4b574de38 [Analysis API] Update test data after rebase 2024-01-06 07:18:47 +00:00
Mikhail Glukhikh 64948fe48f Minor cleanup: JvmMappedScope 2024-01-06 07:11:27 +00:00
Mikhail Glukhikh f5453690a6 K2: prefer base class sources for JVM mapped functions
This commit is a follow-up to 3cb9396b20
"K2: prefer derived class sources for callable copies (e.g. fake overrides)"

#KT-64044 Fixed
2024-01-06 07:11:27 +00:00
Igor Yakovlev c80854eb7c [Wasm/WASI] Extract js-wasi mode to context property 2024-01-05 22:04:25 +00:00
Ivan Kochurkin 1f0fb5a1a8 [FIR] Check for ConeErrorType in doUnify to prevent endless recursion
^KT-64625 Fixed
2024-01-05 19:21:10 +00:00