Commit Graph

109329 Commits

Author SHA1 Message Date
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
Sergey Bogolepov b5cb1fddff [KT-65126] Initial version of Swift export integration tests
Here we reuse infrastructure from existing ObjC Framework tests.
It is not the prettiest approach, and ideally we would like to use XCTest,
but for now we need to quickly kick-start end-to-end tests.
2024-02-10 13:49:01 +02:00
Sergey Bogolepov 2d01c4ca4c [Native][Tests] Extract more common code
* modulemap files are required for Swift export integration tests
* we are going to reuse legacy test infrastructure for now
2024-02-10 13:49:01 +02:00
Sergey Bogolepov 95429b52f9 [Native][Tests] Generalise SwiftCompilation
We will produce dynamic libraries in case of Swift export tests,
and we don't need some flags there as well.
2024-02-10 13:49:01 +02:00
cristiangarcia cb0d78d443 singleOutputFile() method used Task.getProject() and that's not allowed with CC
Required for KTI-1553
2024-02-09 21:35:03 +00:00
Nikita Bobko 21fff5634e [FIR] Fir modality of FirPropertyAccessor
^KT-61798 Fixed
Review: https://jetbrains.team/p/kt/reviews/14230/timeline

Q: How resolved modality of an accessor affects expect/actual matching
   algorithm of properties?
A: It's not expect/actual matching of properties, but expect/actual
   matching of properties setter. Declarations (setters in our case) in
   actual are allowed to have wider visibility but only if the
   appropriate expect is `final`. Before this commit, all property
   accessors were always `final` by mistake. After this commit, they
   have the modality derived from their containingProperty.

Related problem: PositionStrategy for ACTUAL_WITHOUT_EXPECT can be
improved KT-65720

The fix in `resolveModality` is similar to how `resolveVisibility` works

Related tests:
- ConfigurationCacheForAndroidIT.testKotlinAndroidProject
- FirIdeNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.testEnumClassWithAbstractMembers
- FirIdeNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.testEnumEntryInitializerWithOverriddenMember
- FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.testDelegateInterfaceLibrary
- FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.testEnumClassWithAbstractMembers
- FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.testEnumEntryInitializerWithOverriddenMember
- FirIdeNormalAnalysisSourceModuleMemberScopeTestGenerated.testEnumClassWithAbstractMembers
- FirIdeNormalAnalysisSourceModuleMemberScopeTestGenerated.testEnumEntryInitializerWithOverriddenMember
- FirIdeNormalAnalysisSourceModuleSymbolByPsiTestGenerated.testEnumEntryOverride
- FirIdeNormalAnalysisSourceModuleSymbolByPsiTestGenerated.testEnumValueMember
- FirStandaloneNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.testEnumClassWithAbstractMembers
- FirStandaloneNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.testEnumEntryInitializerWithOverriddenMember
- FirStandaloneNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.testEnumClassWithAbstractMembers
- FirStandaloneNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.testEnumEntryInitializerWithOverriddenMember
- FirStandaloneNormalAnalysisSourceModuleMemberScopeTestGenerated.testEnumClassWithAbstractMembers
- FirStandaloneNormalAnalysisSourceModuleMemberScopeTestGenerated.testEnumEntryInitializerWithOverriddenMember
- DiagnosticCompilerTestFE10TestdataTestGenerated*testChangeSetterVisibilityInOverride
2024-02-09 19:49:35 +00:00
Nikita Bobko ab726fee3d [FIR] FirJvmNameChecker: take into account effective modality
^KT-65604 Fixed
Required for: KT-61798
Review: https://jetbrains.team/p/kt/reviews/14230/timeline

Related tests:
- DiagnosticCompilerTestFirTestdataTestGenerated$ResolveWithStdlib.testAnnotationUseSites
2024-02-09 19:49:35 +00:00
Denis.Zharkov cabf7e4fae Introduce documentation for PCLA implementation
^KT-65637 Fixed
2024-02-09 19:47:35 +00:00
Denis.Zharkov 41cc926953 Minor. Reorder some methods in FirInferenceSession
Put them in the order in which they are assumed to be called
2024-02-09 19:47:35 +00:00
Denis.Zharkov b86c0d990e Minor. Reformat PCLA related part at ResultTypeResolver 2024-02-09 19:47:35 +00:00
Denis.Zharkov 05b5cdc918 Minor. Rename and add kdoc for Candidate::onCompletionResultsWritingCallbacks 2024-02-09 19:47:35 +00:00
cristiangarcia 4a74498be7 Outputs are not serializable, FileCollection is
Required for KTI-1553
2024-02-09 19:10:03 +00:00
Mikhail Glukhikh 8f906ca669 K2: refactor/simplify/comment processOverridesForFunctionsWithDifferentJvmName 2024-02-09 19:04:42 +00:00
Mikhail Glukhikh a189509353 K2: build override structure for Java renamed builtins more precisely
#KT-65410 Fixed
2024-02-09 19:04:42 +00:00
Mikhail Glukhikh c6f5e5f297 Add Kdoc to processOverridesForFunctionsWithDifferentJvmName 2024-02-09 19:04:42 +00:00
Mikhail Glukhikh ba374a3978 K2: reproduce KT-65410 in diagnostic/BB tests 2024-02-09 19:04:42 +00:00
Artem Olkov b6c805bbb6 Remove KotlinSirOrigin hierarchy in favour of direct AA usage #KT-65335 Fixed
Merge-request: KT-MR-14229
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-09 18:34:52 +00:00
Alexander.Likhachev c2e0c8b2e9 [Gradle] Introduce KotlinToolingDiagnostics.DependencyDoesNotPhysicallyExist
Instead of silently ignoring the non-existing classpath entries, emit a warning to indicate possible project misconfiguration.
^KT-62101 Fixed
2024-02-09 18:33:30 +00:00
Alexander.Likhachev 5d98758645 [BTA] Add KDoc for CompilationService.calculateClasspathSnapshot 2024-02-09 18:33:30 +00:00
Alexander.Likhachev de04c62df5 [Gradle] Do not try snapshotting non-existent classpath entries
The fix changes only Gradle's side of the transformation to be consistent with general Gradle behaviour for non-existent dependencies in classpath
^KT-62101 In Progress
2024-02-09 18:33:30 +00:00
Alexander.Likhachev c5138b781f [Gradle] Remove senseless try-catch in BuildToolsApiClasspathEntrySnapshotTransform 2024-02-09 18:33:30 +00:00
Alexander.Likhachev 75df4869cc [Gradle] Add test for KT-62101 2024-02-09 18:33:30 +00:00
Dmitriy Dolovov 21afa19fc1 CODEOWNERS: Update ownership under KLIB tool 2024-02-09 18:31:59 +00:00