Commit Graph

109762 Commits

Author SHA1 Message Date
Alexander Udalov d5c2aa4c0c IR: rename and move deepCopyWithVariables
Rename it to `deepCopyWithoutPatchingParents`, move to
`org.jetbrains.kotlin.ir.util`, make it inline+reified, and extract the
common implementation with `deepCopyWithSymbols` into `deepCopyImpl`.
2024-03-11 11:49:10 +00:00
Alexander Udalov 1d38c01afc IR: remove some usages of deepCopyWithVariables
At this point, `deepCopyWithVariables` is the same as
`deepCopyWithSymbols` except that the former doesn't call
`patchDeclarationParents`, which most likely produces incorrect IR in
some call sites.
2024-03-11 11:49:10 +00:00
Alexander Udalov e7e8cba1b4 IR: slightly simplify deep copy interface
Do not pass TypeRemapper explicitly unless an instance of something
other than DeepCopyTypeRemapper is required.
2024-03-11 11:49:10 +00:00
Alexander Udalov d659b76de5 IR: remove usages of SymbolRenamer
Its only implementation was DEFAULT so now it's inlined.
2024-03-11 11:49:10 +00:00
Wojciech Litewka be4e81fbce [IR] Avoid subclassing IrGetValue in FunctionInlining
to avoid custom IrElement implementations.

#KT-65773 In Progress
2024-03-11 11:35:48 +00:00
Wojciech Litewka 747b69c6c0 [IR] Avoid subclassing IrFileImpl
to avoid custom IrElement implementations.

#KT-65773 In Progress
2024-03-11 11:35:48 +00:00
Wojciech Litewka 1c17219a7b [IR] Mark IrConstructorCall as AnnotationMarker
IrConstructorCall is already used to represent both regular constructor
call and annotations.
Implementing AnnotationMarker avoids 'casting' it to this type later on
 in IrTypeSystemContext, which was done with
 a new IrElement implementation. We'd like to
 avoid such implementations, e.g. as so to make the IR hierarchy sealed.

#KT-65773 In Progress
2024-03-11 11:35:48 +00:00
Artem Daugel-Dauge bfbc33e3f6 [Gradle] Fix macOS functionalTests 2024-03-11 09:09:10 +00:00
Wojciech Litewka e9005e4fed [IR] Initialize IrFunction.returnType eagerly, when possible 2024-03-11 09:07:54 +00:00
Wojciech Litewka 392fa8f9bd [IR] Drop ReturnTypeIsNotInitializedException
It was unused since commit a005f2e75d.
2024-03-11 09:07:54 +00:00
Wojciech Litewka a53ba8a47b [IR] Drop IrUninitializedType
#KT-66053 Fixed
2024-03-11 09:07:54 +00:00
Wojciech Litewka d1e8016ab2 [IR] Pass null instead of IrUninitializedType to IrFactory
#KT-66053 In progress
2024-03-11 09:07:54 +00:00
Timofey Solonin 1a4eaf796d Make resources configuration lenient
This prevents resolution failures if resources configuration ends up
selecting java-api variants

^KT-66393
2024-03-11 09:05:35 +00:00
Timofey Solonin 947d4c57e7 Reproduce resources resolution failure with legacy stdlib in dependencies
Sometimes native variants might depend on java-api dependencies.
Resources configuration doesn't have compatibility rules for these and fails to resolve them.

^KT-66393
2024-03-11 09:05:35 +00:00
Timofey Solonin f813ca1975 Allow js target resources publication
^KT-65540
2024-03-11 09:04:25 +00:00
Timofey Solonin 76814a8bbe Test expected js target resources publication bahavior
^KT-65540
2024-03-11 09:04:25 +00:00
Roman Golyshev b765cf3f99 KT-66411 [AA] Add fake source kind for single expression block around array assignments
A wrapper block was introduced as a part of fixing KT-59748, but was
assigned a real source, which had `getOrBuildFir` confused because
of the incorrectly built `KtToFirMapping`

It is relevant for:
- `if`, `when` expressions with an assignment as a single expression
- Kotlin code fragments,
when the assignment is being analysed as a single expression
in the fragment

^KT-66411 Fixed
2024-03-10 15:35:47 +00:00
Roman Golyshev ec06654a73 KT-66411 [AA] Add test for the getOrBuildFir on array assignment expression as a single when/if branch expression 2024-03-10 15:35:47 +00:00
Roman Golyshev 83a80a45a9 KT-66411 [AA] Add more tests for resolving compound set operators 2024-03-10 15:35:47 +00:00
Igor Yakovlev 324d079111 [WasmJs] Prohibit external classes to be a storage of an associated objects
Fix #KT-65355
2024-03-09 10:40:46 +01:00
Igor Yakovlev 6930fc8fed [WasmJs] Add support for external class reflection
Fix #KT-64890
2024-03-09 10:40:46 +01:00
Alexander.Likhachev e302420197 [BTA tests] Use arbitrary named versions instead of just numbered ones
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev bc85375a1e [BTA tests] Provide an optimized way for making exact log line assertions
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 95b832fa8b [BTA tests] Add createFile overload for versioned source creation
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev d3c3e0faad Update dependency verification metadata 2024-03-09 01:36:22 +00:00
Alexander.Likhachev f319ff2c3c [BTA tests] Improve README.md
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev ea3d5371ef [BTA tests] Add changeFile overload for versioned source modification
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 68cf1bdc57 [BTA tests] Use explicit output assertions instead of implicit ones
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 4facf5ffbc [BTA tests] Move GlobalCompiledProjectsCache to a separate file
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 99e13318dc [BTA tests] Allow passing strategy config once to Project instance
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev f634f9dacf [BTA tests] Get BTA implementation version via the API
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 3f6b5ae86d [BTA tests] Introduce BaseTest providing CompilationService instance
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev cf8e65b3c5 [BTA tests] Specify TestDataPath/TestMetadata test data navigation
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev b970b87667 [BTA tests] Split compatibility tests and business logic test suits
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 8051fa56f2 [BTA tests] Split test infra and actual tests
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev b5fbb3f925 [BTA tests] Introduce shortcut assertion expectFailWithError
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 16a07e82bc [BTA tests] Add KDoc to clarify meaning of some symbols
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 60ccdf0e2c [BTA tests] Add example tests
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 15a24319d5 [BTA tests] Add README.md
Also rename `default` to `snapshot` in the test suit names
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 2347f732db [BTA tests] Rename the compatibility tests annotation
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 2a3cc758cf [BTA tests] Add a way to customize IC options
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 74e5b4d844 [BTA tests] Make the module scenario DSL cache key explicit
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 3466153668 [BTA tests] Cache compiled modules in scenario DSL tests
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 566d9852a3 [BTA tests] Finish project compilation after a test
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev a234e4149b [BTA tests] Add scenario DSL for writing typical IC tests
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 7141b4dcbb [BTA tests] Add base assertions DSL
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev c952d74f7c [BTA tests] Implement basic infrastructure for compilation tests
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 90fee75eba [Build, BTA] Add the Build Tools API tests to the aggregate tasks
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 4afb393ff1 [Build, BTA] Add the build tools api tests module
The module is configured to run a bunch of test suites defined as API pairs. Currently those are `CURRENT API` – `CURRENT IMPL`, `CURRENT API` – `1.9.20 IMPL`, `1.9.20 API` – `CURRENT IMPL`
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00
Alexander.Likhachev 0196928af7 [BTA] Add debug logging about the used compilation strategy
^KT-61860 In Progress
2024-03-09 01:36:22 +00:00