Commit Graph

107261 Commits

Author SHA1 Message Date
Kirill Rakhman eb0f4167b3 [FIR2IR] Remove obsolete TODO
#KT-62865
2023-12-15 16:25:46 +00:00
Andrey Yastrebov 0c5a925b6e KT-62745: update CocoaPodsPodspecIT tests 2023-12-15 15:38:51 +00:00
Andrey Yastrebov f4097db0c2 KT-62745: add missing BUILT_PRODUCTS_DIR test 2023-12-15 15:38:51 +00:00
Andrey Yastrebov 259a2f5ec0 KT-62745: Set 'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO' in CocoaPods integration 2023-12-15 15:38:51 +00:00
Andrey Yastrebov 1eb6ae4d21 KT-62745: Add shouldFailEmbedAndSignAppleFrameworkForXcodeWithUserScriptSandboxingEnabled test 2023-12-15 15:38:51 +00:00
Andrey Yastrebov 5982543867 KT-62745: Add sandboxing error message to embedAndSignAppleFrameworkForXcode task 2023-12-15 15:38:51 +00:00
Pavel Kunyavskiy f50fab65cc [IrActualizer] Update doc on how the actualization process works. 2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 7813bb35cf [FIR2IR] Provide remapped f/o symbols to declaration storage
After a generation of fake overrides some code may still to refer old
  symbols from declaration storage (like computation of overridden
  symbols for lazy functions), so we need to remap those symbols using
  information from IR f/o generator
2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 97cf62e291 [FIR2IR] Properly calculate overridden symbols for lazy declarations
This change affects only mode with IR f/o generator

The old way of overridden computation with fir2ir f/o generator relied
  on the fact that fir2ir generator creates IR for all f/o and fills
  its caches. But with IR f/o generator enabled, we don't call fir2ir
  generator, so some caches are missing. And for this mode it's enough
  to acquire the symbol using the original declaration symbol and the
  lookup tag of the corresponding supertype

Relates to KT-64202
2023-12-15 15:38:10 +00:00
Pavel Kunyavskiy dcd3f3b155 [FIR2IR] Replace fake override symbols with normal ones
Fir2Ir introduces temporary symbols to avoid creating
fake overrides themselves. Further pipeline is not ready to
these symbols. That's why we have introduced separate pass,
that replaces all this symbols with real fake override
symbols, after they are created.

^KT-63645
2023-12-15 15:38:10 +00:00
Pavel Kunyavskiy c485382e80 [FIR2IR] Rework actualization pipeline
There are a lot of restrictions between different parts of the pipeline.

1. Fake overrides can't be built before classes are actualized
2. Constants can't be evaluated before callables are actualized
3. Callables can't be actulaized before fake overrides are built
4. Checkers can't run before constants are evaluated

This commit reorders things to make all these restrictions happy.

^KT-63644
2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 9609ac6908 [FIR2IR] Generate fake-override symbols for properties
^KT-63644 Fixed
2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 1d2601ccae [FIR2IR] Generate fake-override symbols for functions
^KT-63644
2023-12-15 15:38:10 +00:00
Ivan Kylchik 46cb108a23 [K2] Forbid to use "get class" in the context of string concat and equality
#KT-63941 Fixed
2023-12-15 13:54:13 +00:00
Svyatoslav Scherbina 8a8eb18efd [K/N][tests] Make mention of the test data file grouping more visible
When running `codegen/box` tests, Kotlin/Native test infrastructure
divides test data files into groups and compiles each group in a single
compilation.
As a result, compilation problem with one test can cause an unrelated
nearby test to fail.

To make this less frustrating, this commit adjusts test failure reports:
it moves the test grouping mention from the bottom of a report to the
top and makes the wording more clear and actionable.
2023-12-15 12:25:04 +00:00
Roman Golyshev deb7999bfb KT-64205 [AA] Adjust defaultCallableShortenStrategy to import only top-level callables
^KT-64205 Fixed
2023-12-15 10:49:25 +00:00
Roman Golyshev d5896f20f0 KT-64205 [AA] Add shortening with default settings to the testData 2023-12-15 10:49:24 +00:00
Roman Golyshev 146d93a044 KT-64205 [AA] Rearrange testData for reference shortener
Get rid of `referenceShortener/referenceShortener` nested directory
2023-12-15 10:49:24 +00:00
Dmitriy Novozhilov 21b7405435 Advance bootstrap to 2.0.0-dev-10501 2023-12-15 10:40:04 +00:00
Kirill Rakhman 3bfcf3090c [FE] Use indexed loop to prevent CME in incorporation
#KT-60225 Fixed
2023-12-15 08:47:09 +00:00
Aleksei.Cherepanov 3e41faf91f Add KotlinBuilder 'dumb mode' flag
A new system property was added to enable a 'dumb mode' for KotlinBuilder.
In this mode it is possible to disable IC caches, but don't request rebuild
And all IC trackers will still work

^KT-64305 Fixed


Merge-request: KT-MR-13524
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-12-15 00:20:54 +00:00
Anna Kozlova 033f330703 [psi] remove unused super interface from java psi
given that the interface itself is not used externally,
the change is binary compatible

^KT-64320 fixed
2023-12-14 18:25:56 +00:00
Anna Kozlova cf57b44a1e [LC] avoid icon calculation in compiler
move calculation to the IDE icon provider

^KT-64282 fixed
2023-12-14 18:24:54 +00:00
Brian Norman b2041e0927 [FIR] Disable data flow from in-place lambdas
There are many complications with the current design of passing data
from within in-place lambdas to surrounding code. Solving these
complications will involve more time to investigation than is available
within the K2 release. So we are disabling passing type statement
information from lambdas for the time being until more time can be
devoted to a more complete solution.

^KT-60958 Fixed
^KT-63530 Fixed
2023-12-14 16:40:27 +00:00
Brian Norman 645970fa7a [Parcelize] Fix subclass check of deprecated Parceler interface
^KT-59949 Fixed
^KT-60090 Fixed
2023-12-14 16:36:07 +00:00
Svyatoslav Scherbina 84388d5f04 Bump Kotlin/Native version in KGP to 2.0.0-dev-10477 2023-12-14 14:23:31 +00:00
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