Commit Graph

107235 Commits

Author SHA1 Message Date
Nataliya.Valtman ed144a106d Add test for case when BuildFusService can't be injected
#KT-63990
2023-12-14 14:18:59 +00:00
strangepleasures 7b841d90e6 [KAPT] KT-64303 Dispose resources allocated by Standalone Analysis API; re-enable Kapt4IT
Merge-request: KT-MR-13510
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2023-12-14 14:10:14 +00:00
Bogdan Mukvich c66370bf93 Add gradle checksum to kotlin-stdlib-docs-legacy
^KTI-1456
2023-12-14 13:54:52 +00:00
Sergey Bogolepov 00caf0f1e1 [Swift Export] Check SIR validity in pass tests 2023-12-14 12:38:12 +00:00
Sergey Bogolepov 9fde7e0d35 [Swift Export] Create infrastructure for SIR validation 2023-12-14 12:38:12 +00:00
Pavel Punegov fc1d7df0bc [K/N][build] Simplify stdlib build
Build stdlib with a single task that also sets all supported targets
to the manifest file.
Remove manifest merging as it is not needed anymore.
2023-12-14 11:33:20 +00:00
Pavel Punegov 2d2714c8de [K/N] Move runtime bitcode files out of stdlib
Native bitcode files were moved out of the stdlib to the default
location of bitcode files in the dist.
Now it is possible to build stdlib separately and once as a klib
without bitcode files inside.
2023-12-14 11:33:20 +00:00
Nikita Bobko 599998039e [IR] Use resolveFakeOverrideMaybeAbstract instead of resolveFakeOverride in hasStableParameterNames
Well, the resolved fake-override can be ABSTRACT

^KT-64045 Fixed
2023-12-14 11:23:51 +00:00
Dmitriy Novozhilov fb00c1dfb6 [FIR] Prohibit suspend anonymous functions in statement position
^KT-62018 Fixed
^KT-62019
2023-12-14 10:32:59 +00:00
Artem Olkov cae6e0ee0f Add checks that kotlin-native.swift-export.enabled is actually turned on
Merge-request: KT-MR-13506
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2023-12-14 10:27:19 +00:00
Dmitriy Novozhilov 28f0f1ea88 [FIR2IR] Properly set isAssignable flag for parameters of tailrec functions
^KT-63973 Fixed
2023-12-14 09:58:03 +00:00
Dmitriy Novozhilov f4e3203cd8 [FIR] Unregister java element finders from previous sessions
The problem here is that for common session we register `FirJavaElementFinder`
  which provides light classes based on expect classes. And then
  at the start of analysis of jvm module we register one another
  `FirJavaElementFinder`, which sees actual classes and uses them to
  build light classes

But, because class ids of expect and actual class pair are the same and
  element finders are ordered by creation order, when java resolve tries
  to resolve some class, it founds light class based on expect class,
  even if we are already in platform session

To fix this problem, it was decided to unregister all previous element
  finders on creation of each new session, so old finders won't interfere
  with analysis

^KT-63612 Fixed
^KT-64296
2023-12-14 09:51:15 +00:00
Anastasia.Nekrasova e58b5e7d22 K2: change resolution for deprecated actual declaration
This commit addresses a scenario where an 'actual' declaration is marked
with a Deprecated annotation at the 'Hidden' level, while the
corresponding 'expect' declaration is not. When resolving,
'CheckHiddenDeclaration' marks the 'actual' declaration as unsuccessful,
leading to the selection of the 'expect' declaration as the successful
candidate.

'FirDeprecationChecker' handles a case where an 'actual' class is
annotated with Deprecated, but the 'expect' class is not. During the
checking of the 'actual' class constructor, 'CheckHiddenDeclaration'
skips it due to the absence of a direct Deprecated annotation.
'FirDeprecationChecker' then identifies this constructor and reports a
DEPRECATION_ERROR.

'FirDeprecationChecker' will now be applied to solving problems related
to 'actual' declarations with corresponding Deprecated annotations. The
process remains the same: 'CheckHiddenDeclaration' will skip the
'actual' declaration, and then 'FirDeprecationChecker' will identify it
and report the error.

^KT-61792 Fixed
2023-12-14 09:21:43 +00:00
Svyatoslav Scherbina 2cdf8cd7b1 Native: support Objective-C instancetype in more cases in cinterop
Objective-C has a special type, "instancetype". Generally, it is a type
that matches the method receiver type. So, if `Foo.foo` method returns
`instancetype`, then `Foo.foo()` would be of type `Foo`, while
`Bar.foo()` would be of type `Bar` (where `Bar` is a subclass of `Foo`).

Surprisingly, `instancetype` can be used not only as a return type, but
also somewhere inside a return type. cinterop wasn't ready for this.

This commit expands implementation of `instancetype` in cinterop to
cover more cases.

^KT-59597 Fixed
2023-12-14 08:57:29 +00:00
Dmitriy Novozhilov 149e1e02f6 [FIR2IR] Simplify building of declarations list for Fir2IrLazyClass 2023-12-14 08:32:58 +00:00
Dmitriy Novozhilov 533d824eb3 [FIR2IR] Minor: simplify function in FakeOverrideGenerator 2023-12-14 08:32:58 +00:00
Dmitriy Novozhilov 39063e59f6 [FIR2IR] Treat assignment on smartcasted this in classes using FIR instead of IR
KT-57105
2023-12-14 08:32:58 +00:00
Dmitriy Novozhilov 56a48b1148 [Test] Add missing WITH_STDLIB directive to test
This particular test references kotlin.reflect.KProperty1 both in
  common and platform sourceset. And if there is no stdlib in dependecies
  it resolves to KProperty1 from builstins, which is expect (see KT-64061),
  which leads to broken expectations that after IR actualization there
  are no referenced expect classes
2023-12-14 08:32:58 +00:00
Dmitriy Novozhilov f5028bfc27 [Test] Reformat test for KT-57105 and add an additional case to it 2023-12-14 08:32:58 +00:00
Pavel Kunyavskiy 8e047e6d8a [FIR2IR] Make all source sets friends for IrFakeOverrideBuilder
^KT-63644
2023-12-14 08:32:58 +00:00
Dmitriy Novozhilov 60d77fbb90 [FIR2IR] Fix left usages of symbol.owner in DelegatedMemberGenerator 2023-12-14 08:32:58 +00:00
Dmitriy Novozhilov da531bc261 [FIR2IR] Don't access symbol.owner in DataClassMembersGenerator 2023-12-14 08:32:58 +00:00
Vladimir Sukharev 50f1ea79c5 [Tests] Detect frontend type within FirIrDumpIdenticalChecker
^KT-64256 Fixed
2023-12-13 22:39:46 +00:00
Vladimir Sukharev 82c5b745e2 [Tests] Adjust FirIdenticalCheckerHelper behavior in case .ir.txt file is absent
.ir.txt file may be absent for the following test kinds with // DUMP_IR
- codegen tests with // IGNORE_BACKEND_K1: ANY
- FirScriptCodegenTestGenerated, since it does not have K1 counterpart
- Fir*PluginBlackBoxCodegenTestGenerated, since it does not have K1 counterpart

^KT-64256 Fixed
2023-12-13 22:39:46 +00:00
Vladimir Sukharev ec3dd43edc [Tests] Enforce FIR_IDENTICAL for Fir tests with IrTextDumpHandler
^KT-64256 Fixed
2023-12-13 22:39:45 +00:00
Dmitriy Dolovov cbf21acede IR text tests: Don't dump signature mangled names for IR-based descriptors
^KT-57788
2023-12-13 21:33:26 +00:00
Yan Zhulanow 07aad38c69 [Analysis API] Do not hold a reference to 'KtCodeFragment' from modules
'KtModule' references may be cached for indefinite time. If so,
unused fake documents will wait long before being cleaned up.

^KT-62562 Fixed
2023-12-13 20:29:39 +00:00
Vladimir Sukharev a59742258e [K/N] Speedup test CInterop/executable/bitfields/ 2023-12-13 19:06:57 +00:00
Artem Kobzar 1473b4bb41 [K/Wasm] Introduce JsBigInt type 2023-12-13 18:44:57 +00:00
Nikita Bobko 8bbbbfa3ce [FIR] Fix MT intellij tests
MT stands for "modularized tests"

^KT-64166 Fixed
Review: https://jetbrains.team/p/kt/reviews/13517/timeline

This commit fixes:

    java.lang.IllegalArgumentException: Local <local>/<anonymous> should never be used to find its corresponding classifier
            at org.jetbrains.kotlin.fir.resolve.providers.impl.FirProviderImpl.getFirClassifierByFqName(FirProviderImpl.kt:252)
            at org.jetbrains.kotlin.fir.resolve.providers.impl.FirProviderImpl$SymbolProvider.getClassLikeSymbolByClassId(FirProviderImpl.kt:60)
            at org.jetbrains.kotlin.fir.resolve.providers.impl.FirCachingCompositeSymbolProvider.computeClass(FirCachingCompositeSymbolProvider.kt:131)
            at org.jetbrains.kotlin.fir.resolve.providers.impl.FirCachingCompositeSymbolProvider.access$computeClass(FirCachingCompositeSymbolProvider.kt:27)
            at org.jetbrains.kotlin.fir.resolve.providers.impl.FirCachingCompositeSymbolProvider$special$$inlined$createCache$1.invoke(FirCachesFactory.kt:75)
            at org.jetbrains.kotlin.fir.resolve.providers.impl.FirCachingCompositeSymbolProvider$special$$inlined$createCache$1.invoke(FirCachesFactory.kt:69)
            at org.jetbrains.kotlin.fir.caches.FirThreadUnsafeCache.getValue(FirThreadUnsafeCachesFactory.kt:40)
            at org.jetbrains.kotlin.fir.resolve.providers.impl.FirCachingCompositeSymbolProvider.getClassLikeSymbolByClassId(FirCachingCompositeSymbolProvider.kt:158)
            at org.jetbrains.kotlin.fir.resolve.transformers.mpp.FirExpectActualResolver.findExpectForActual(FirExpectActualResolver.kt:41)
2023-12-13 18:42:14 +00:00
Dmitriy Dolovov e9b4b8919d [KLIB Resolver] Add a heuristic to look up for KLIB file given only unique name
This fix adds a workaround to allow Kotlin/Native compiler to resolve
KLIB library if only library name was passed via `-l` CLI argument.

^KT-63931
2023-12-13 18:06:07 +00:00
Dmitriy Dolovov 2b1fc51f89 [KLIB Resolver] Deprecate UnresolvedLibrary.substitutePath()
This method in unused in Kotlin compiler and IDEA plugin.
2023-12-13 18:06:07 +00:00
strangepleasures 1015ae858e [KAPT] KT-64301 Report invalid enum value names
Merge-request: KT-MR-13520
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2023-12-13 17:53:52 +00:00
Mikhail Glukhikh 676e350b6f K1/K2: add test to confirm behavior of KT-63243 2023-12-13 17:43:45 +00:00
strangepleasures b84aa190d7 [KAPT] KT-64297 Mark deprecated members with @java.lang.Deprecated
Merge-request: KT-MR-13521
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2023-12-13 17:18:54 +00:00
Dmitriy Novozhilov 34bf32866b [Test] Remove redundant K1 ignore directives from K2 MPP box tests
Corresponding tests for K1 are no longer generated, so there is no need
  to ignore them anymore
2023-12-13 16:47:42 +00:00
Dmitriy Novozhilov b4947e6cfe [Test] Exclude K2 MPP codegen box tests from K1 generated suites
Those tests always were muted for K1 because of incompatible module
  structure in testdata, so there is no actual sense to even generate
  them for K1
2023-12-13 16:47:42 +00:00
Kirill Rakhman b7bdbd270f [FIR] Add comment for keeping the two places where class scopes are build in sync. 2023-12-13 16:46:24 +00:00
Kirill Rakhman d574d859cb [FIR] Clean up unused dummy code 2023-12-13 16:46:24 +00:00
Kirill Rakhman 44b3c66ad7 [FIR] Add companion scope before static scope
Static scope is checked first during resolution
(scopes are in reverse order).
This fixes a difference between how K1 and K2 resolve annotations.

#KT-63249 Fixed
2023-12-13 16:46:24 +00:00
Kirill Rakhman 2c74a2356a [FIR] Fix IOOBE in ConeTypeRenderer for bad extension function types 2023-12-13 16:46:24 +00:00
Ilya Gorbunov 5ce2a2cbee Use strongly typed task GenerateProjectStructureMetadata to tweak kpsm.json 2023-12-13 15:40:25 +00:00
Ilya Gorbunov e0bc0b81c6 [kotlin-test] Drop subprojects unneeded anymore KT-61969 2023-12-13 15:40:25 +00:00
Ilya Gorbunov 35aa17e1d0 Pack K/N stdlib sources into single zip
With the directory structure similar to one of a multiplatform library,
where each source set sources are placed into the directory
named after this source set.

Do not use legacy projects for building relative paths
2023-12-13 15:40:25 +00:00
Ilya Gorbunov fb74c18235 Fix maven plugin IT install and kotlin-bom dependencies after KT-61969 2023-12-13 15:40:25 +00:00
Ilya Gorbunov b0bee09948 Change Gradle test expectations after KT-61969 2023-12-13 15:40:25 +00:00
Ilya Gorbunov 653fc03cbc Replace kotlin-test project dependencies in dist
KT-61969
2023-12-13 15:40:25 +00:00
Ilya Gorbunov c40de28775 Replace kotlin-test-js project dependencies in the project
KT-61969
2023-12-13 15:40:25 +00:00
Ilya Gorbunov 4b2e1240eb Replace kotlin-test-wasm project dependencies in the project
KT-61969
2023-12-13 15:40:25 +00:00
Ilya Gorbunov d2aae67e03 Replace kotlin-test project dependencies in the project
Use dependency helper function that chooses whether to take them
from the bootstrap repository or from a configuration of kotlin-test

KT-61969
2023-12-13 15:40:25 +00:00