Commit Graph

108751 Commits

Author SHA1 Message Date
Sebastian Sellmair fd33249c47 [ObjCExport] Add tests for Char type translation
^KT-65348 Fixed
2024-02-12 16:14:38 +00:00
Sebastian Sellmair e53e94516f [ObjCExport] AA: Enable generation of base declarations
^KT-65738 Fixed
2024-02-12 16:13:50 +00:00
Sergey.Shanshin 2ae2f09fee [FIR] Fixed phase for FirCompanionGenerationProcessor to COMPANION_GENERATION
Phase COMPILER_REQUIRED_ANNOTATIONS causes errors in the kotlinx serialization tests:

org.jetbrains.kotlin.fir.symbols.FirLazyResolveContractViolationException: `lazyResolveToPhase(COMPILER_REQUIRED_ANNOTATIONS)` cannot be called from a transformer with a phase COMPILER_REQUIRED_ANNOTATIONS.
`lazyResolveToPhase` can be called only from a transformer with a phase which is strictly greater than a requested phase;
 i.e., `lazyResolveToPhase(A)` may be only called from a lazy transformer with a phase B, where A < B. This is a contract of lazy resolve
2024-02-12 15:54:11 +00:00
Sergey.Shanshin 7af2aebbe2 [FIR] Fixed resolving type by FirUserTypeRef if type is parametrized
If a parameterized type ref is passed during the `FirSupertypeGenerationExtension.TypeResolveService#resolveUserType` call, the `WRONG_NUMBER_OF_TYPE_ARGUMENTS` error occurs.
2024-02-12 15:54:11 +00:00
Sergey.Shanshin 84ad12be57 [KxSerialization] Added inspections on custom serializer parameters
Added inspections to check:
- custom serializer on class has as many parameters in primary constructor as the serializable class of type arguments
- all parameters in custom serializer has `KSerializer` type
- property in serializable class not parametrized by type parameter
- custom serializer on property of serializable class have no parameters in primary constructor
2024-02-12 15:54:11 +00:00
Pavel Kunyavskiy 9532172a22 [Fir2IR] Don't use FIR f/o builder when IR f/o builder is enabled
Before this commit, fir f/o builder was inconsistently
disabled in some places, while it should work only for lazy declarations

Attempt to use it for non-lazy declarations, without maintaining
invariant, that it would also be used for super classes
led to unpredictable results.

This commit introduces opt-in, and marks all related API to three types
* Propagate error to user
* Fine to use, as it's checked if ir f/o builder is enabled
* Fine to use, as it is definitely a lazy class.

Several cases of missing checks was fixed.

^KT-65707
2024-02-12 15:02:50 +00:00
cristiangarcia 74193aefb4 Kotlin maven publication tasks are not compatible with Configuration Cache
Required for KTI-1553
2024-02-12 14:45:06 +00:00
Yahor Berdnikau cf1a1693b3 [Gradle] Remove exceptions for warnings-as-errors flag enable
^KT-56904 Fixed
2024-02-12 14:39:33 +00:00
Yahor Berdnikau 11fee106b2 [Gradle] Fix warnings in kotlin-native-build-tools
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau de40306f8e [Gradle] Fix warnings in KotlinPerformancePlugin
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau 05f3019fcf [Gradle] Fix warnings in experimentalConifguration.kt
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau d2c8565d55 [Gradle] Fix warnings in SetupKotlinNativePlatformDependenciesAndStdlib
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau e10b4066d5 [Gradle] Fix warnings in KotlinNativeTargetPreset
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau afd5dbec81 [Gradle] Fix warnings in DefaultCInteropSettings
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau bbf933ce70 [Gradle] Fix warnings in YarnWorkspaces
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau 40fa94b23b [Gradle] Fix warnings in Yarn
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau 00f8c23092 [Gradle] Fix warnings in KotlinNpmInstallTask
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau aba89b6676 [Gradle] Fix warnings in CreateTargetConfigurationsSideEffect
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau 1ad9462c72 [Gradle] Fix warnings in CreateDefaultCompilationsSideEffect
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau e72704ce86 [Gradle] Fix warnings in ConfigureBuildSideEffect
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau 36233bd17d [Gradle] Fix warnings in GradleLoggerAdapter
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau 3586f624a3 [Gradle] Fix warnings in kotlinTargetPresets.kt
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau 85f7dd1c20 [Gradle] Fix warnings in kotlinTestDependencyManagement.kt
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
eugene.levenetc 0ec9f2a8b9 [ObjCExport] Constructors fixes, cloneables handling, annotations 2024-02-12 13:30:07 +00:00
cristiangarcia 545753ff4c Dokka is not compatible with ConfigurationCache
Required for KTI-1553
2024-02-12 12:13:59 +00:00
cristiangarcia a9d0e8574e Make artifacts-tests:test ConfigurationCache compatible
Required for KTI-1553
2024-02-12 12:06:12 +00:00
Sergej Jaskiewicz 5836067082 [klib] Add error suppression to a signature clash diagnostic test
Currently, REDECLARATION is not reported if two conflicting declarations
are in different source sets (KT-59898). However, when it's fixed,
we want this test to keep testing the signature clash diagnostic,
and not fail because of unexpected REDECLARATION error.
2024-02-12 11:22:47 +00:00
Sergej Jaskiewicz f26e470e80 [klib] Don't show signature clash diagnostics for local declarations
For some reason type parameters end up in
`GlobdalDeclarationTable`, and thus we tracked them in
`IdSignatureClashDetector`, which wasn't right and confused the
diagnostic renderer that uses
`org.jetbrains.kotlin.resolve.MemberComparator` for sorting the
declarations to display in diagnostics. That comparator doesn't know
jow to work with type parameters.

Besides, type parameters, like many other types of declarations, are not
considered public wrt KLIB ABI, so there's no need to show
CONFLICTING_KLIB_SIGNATURES_ERROR for them.

^KT-65723 Fixed
2024-02-12 11:22:46 +00:00
strangepleasures e363a1228d KT-65404 KAPT should print a warning if stub generation is triggered for an interface with method bodies but without -Xjvm-default=all or -Xjvm-default=all-compatibility
Merge-request: KT-MR-14139
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-12 11:17:32 +00:00
Pavel Mikhailovskii d75463a7d5 [KAPT] KT-65399 Fix rendering of types with names starting with $.
Solves a specific issue with Kotlin serialization, and most likely,
similar issues with synthetic classes.

Types with `$` in other positions will be still rendered incorrectly
due to imprecise conversion of such types from Kotlin to Java
in the analysis API.


Merge-request: KT-MR-14235
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-12 11:15:36 +00:00
Kirill Rakhman 58264e177f [FIR] Improve UPPER_BOUND_VIOLATED message
Suggest removing explicit type arguments when the upper bound is a
captured type since the only way to satisfy the upper bounds is
by letting the type variable be inferred to its bound.

#KT-65681 Fixed
2024-02-12 10:42:51 +00:00
Kirill Rakhman 91e4837c95 [Tests] Add test for #KT-65712 2024-02-12 10:42:51 +00:00
Kirill Rakhman 9391ff8179 [FIR] Implement toString in FirTypeRefSource 2024-02-12 10:42:50 +00:00
Pavel Kirpichenkov 3dede06d51 [Tests] Add diagnostic tests for sealed class inheritors
- Fix unrelated resolution errors in an existing test
- Add separate test for sealed classes and interfaces in HMPP projects,
located in different source sets

KT-64919
2024-02-12 10:17:20 +00:00
Nikolay Lunyak 3db7df6898 [FIR] Fix FirDuplicateParameterNameInFunctionTypeChecker
It was supposed to check only function types...

Also note that it's probably impossible
to write a simpler test right now,
because we have a massive problem that
we ignore `FirTypeRef`s with `null`
sources despite having a dedicated
family of checkers for them
specifically. This will be fixed
separately as KT-65647.

^KT-65584 Fixed
^KT-65647
2024-02-12 09:00:15 +00:00
Nikolay Lunyak 8ec248131d [FIR] Reproduce KT-65584
The diagnostic target source element
type was changed to prevent crash due
to `checkPsiTypeConsistency()` in
`duplicateParameterNameSimplified.fir.kt`

^KT-65584
2024-02-12 09:00:15 +00:00
Kirill Rakhman ef29879740 [FIR] Remove hack for @OnlyInputTypes
#KT-65704
2024-02-12 08:47:10 +00:00
Kirill Rakhman b90598823e [FIR] Improve approximation of captured types
- Handle flexible types in recursion check
- Handle intersected supertypes separately
- Make check when not to approximate captured types in type argument
  position more fine-grained.
  Only apply it to case when the captured type is replaced by a star
  projection.
  All other cases are handled by recursive calls to
  approximateCapturedType

#KT-65377 Fixed
2024-02-12 08:47:10 +00:00
Pavel Kunyavskiy 831ef0f909 [FakeOverrideBuilder] Fix referencing a local type from a return type
Copying tree part happens in two stages.
1. Collect all symbols to copy and create new version of them
2. Do copy tree, replacing collected symbols

For f/o builder 1-st stage traversed more nodes, than seconds.
This led to unbound symbols in tree.

^KT-65273 Fixed
2024-02-12 08:39:35 +00:00
cristiangarcia 90db7cd685 Mark checkIdeDependenciesConfiguration as notCompatibleWithConfigurationCache
Required for KTI-1553
2024-02-11 21:42:55 +00:00
Vladimir Sukharev ab6c3847bc [K/N][Tests] Add TODO for KT-64879
^KT-64879
2024-02-11 21:30:03 +00:00
Vladimir Sukharev a0ffea48a2 [K/N][Tests] Use runProcess in doFileCheck
^KT-61259
2024-02-11 21:30:03 +00:00
Vladimir Sukharev 7cb372e66f [K/N][Tests] Migrate test signext_zeroext_objc_export.kt
^KT-61259
2024-02-11 21:30:03 +00:00
Alexander Udalov f3d3ae8416 IR: take startOffset/endOffset of parent class in FakeOverrideCopier
There's no issue or tests because it doesn't affect user-visible
behavior. The only effect of this change is that after IR fake override
builder is enabled by default (KT-61360), tests in
`compiler/testData/ir/sourceRanges` will now pass because using class
start/end is the current behavior in K2 and test data checks it.
2024-02-11 16:53:47 +00:00
Alexander Udalov 38824f62b8 Fir2Ir: minor, inline origin FAKE_OVERRIDE when creating fake overrides 2024-02-11 16:53:47 +00:00
Vladimir Sukharev 0ba509dcd6 [K/N][Tests] Adjust test signext_zeroext_interop.kt for different cache modes
^KT-61259
2024-02-11 12:44:31 +00:00
Vladimir Sukharev 370f138ad4 [K/N][Tests] Migrate test signext_zeroext_interop.kt
^KT-61259
2024-02-11 12:44:31 +00:00
Jinseong Jeon b0ad91a98c SLC: create backing field for deprecated property
...since they still appear at JVM bytecode.

Also, ULC doesn't look at deprecated annotation for bail-out criteria.

^KT-65393 fixed
2024-02-11 01:41:44 +00:00
Jinseong Jeon 0533c73910 SLC: add tests about deprecated-hidden property/accessor
^KT-65393
^KTIJ-27244
2024-02-11 01:41:43 +00:00
Sergey Bogolepov 300369000f [KT-65126] Fix visibility of enums according to failing tests 2024-02-10 14:31:42 +00:00