Commit Graph

33 Commits

Author SHA1 Message Date
Dmitriy Novozhilov e431a96897 [FIR2IR] Properly calculate overridden functions for lazy fake overrides
For detailed explanation see the comment to `computeBaseSymbolsWithContainingClass`
  function in `FakeOverrideGenerator.kt`

^KT-65592
2024-02-22 15:56:57 +00:00
Pavel Kunyavskiy e6f4d6e6fa [Tests] Use stable order for ir/kotlinLike dumps
^KT-65406
2024-02-16 10:19:38 +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
Pavel Kunyavskiy b4062c8974 [Fir2IR] Fix fake override generation for lazy accessors
^KT-65595 Fixed
2024-02-09 13:27:15 +00:00
Pavel Kunyavskiy 1cc138431d [Fir2IR] Get rid of simple symbol table usages
We have two sources of truth in Fir2Ir - declaration storages,
which maps fir to ir symbols and symbolTable which maps
IdSignature to ir symbol.

The long-term goal is to have only one - declaration storages. This
commit goes to this goal by removing all symbolTable usages that are
straightforward to remove, i.e., all except:

1. classes as there is some code, that uses signature inside ClassSymbol
2. functions/properties as sometimes declaration storage fails to match
symbols correctly (i.e. for generated data class members)
3. type parameters, as we need to remove functions first.

As a side effect, it fixes some of the signature clash cases on valid
code, as we no longer rely on signature uniqueness, except cases
mentioned above.

^KT-65274 Fixed
^KT-64990
2024-02-06 08:55:35 +00:00
Pavel Kunyavskiy caa6918031 [FIR2IR] Fix handling private setters in anonymous classes
^KT-65290 Fixed
2024-02-02 16:07:35 +00:00
Kirill Rakhman 9ec0210c04 [FIR] Support enhancing intersection overrides
When a type annotated with @PurelyImplements (explicitly or implicitly)
inherited some methods from a java supertype and the purely implemented
Kotlin supertype, it was inconsistent which of the signatures the
intersection override would have (with or without flexible types).
This commit adds support for the enhancement of intersection overrides.
If one of the overridden methods has non-flexible types, the enhanced
method will have non-flexible types.
This fixes some false negative nullability type mismatches.

#KT-59921 Fixed
2024-01-31 11:16:50 +00:00
Pavel Kunyavskiy 5e25707648 [Fir2IR] Don't compute overriddenSymbols if ir builder is enabled
Ir builder would recompute them anyway, while computation
can lead to triggering computations in lazy classes too early,
which is incorrect.

^KT-65116
2024-01-25 09:22:07 +00:00
Pavel Kunyavskiy 09713bb89e [Fir2IR] Don't add invisible fake overrides to Lazy class
^KT-65056
2024-01-22 13:30:05 +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
Dmitriy Novozhilov c25cde8871 [FIR2IR] Provide correct module data to FirModuleDescriptor
Properly implement friend modules visibility check

^KT-61384 Fixed
^KT-62475 Fixed
2023-10-12 06:47:02 +00:00
Igor Chevdar 1df93e1611 [box-tests] Added a reproducer for #KT-61924 2023-09-15 09:26:54 +00:00
Pavel Kunyavskiy 91e96e9f31 [Fir2Ir] Introduce testing with IrFakeOverrideBuilder
^KT-61514
2023-08-31 13:12:15 +00:00
Dmitriy Novozhilov 4e3dbcada3 [FIR2IR] Always look for already generated fake overrides before creating them
This change covers the case where some f/o was generated in common module
  and it is referenced in platform code. But signature of this f/o may be
  different in different modules because of e.g. actualization of value
  parameters with actual typealias

^KT-60850 Fixed
2023-08-09 09:40:23 +00:00
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00
Dmitriy Novozhilov 83cbd322fd [Test] Prohibit declaring dependency on the same module with different kinds in module structure 2023-01-17 14:51:27 +00:00
Dmitriy Dolovov 444cdaa2d8 [Native][tests] Re-enable internalFromFriendModule codegen box test
^KT-53723

This reverts commit 6594ebe487f0758e0fab880e2902d3d28eca7f44.
2022-08-30 07:56:18 +00:00
Igor Chevdar ea4a841056 [box-tests] Ignored a test for K/N for now
The test checks internal declarations visibility from friend module,
the K/N test system is broken for now if uses caches
2022-08-30 07:29:07 +00:00
Dmitriy Novozhilov 6e2402620f [FIR] Fix collecting member candidates on receiver with smartcast
^KT-51460 Fixed
^KT-51827
2022-04-07 12:18:48 +00:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Ivan Kylchik edd608446e [TESTS] Move WITH_RUNTIME directive to file level 2021-11-08 23:50:34 +03:00
Georgy Bronnikov 534beb8553 IR: Test for toSkip(this) in T.resolveFakeOverride()
^KT-49371 Fixed
2021-10-29 12:13:57 +03:00
Roman Artemev ed8e7c754d [IR] Add test for internal fake overrides from friend module 2021-10-07 16:00:48 +03:00
Alexander Udalov eec98314c8 Revert "Change order of WITH_RUNTIME and FILE. Wrong order brakes module pattern."
This reverts commit 073a500370.
2021-02-22 10:14:32 +01:00
Pavel Punegov 073a500370 Change order of WITH_RUNTIME and FILE. Wrong order brakes module pattern. 2021-02-21 11:12:33 +03:00
Roman Artemev ca6e1b8f1b Add box test for #KT-43831 2021-02-09 11:33:34 +03:00
Dmitriy Novozhilov 6a7cd0c811 [Test] Add ability to specify applicability of diagnostic to module or file 2021-01-22 13:51:19 +03:00
Alexander Gorshenev 7815529eed [Private fake overrides] Tests for private fake overrides construction 2020-10-22 13:23:29 +03:00
Mikhail Glukhikh c0f8be5d4e [FIR2IR] Generate setter call for assignments, if any 2020-03-18 17:09:35 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Dmitry Jemerov 4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Alexander Udalov ee554d2e2f Unwrap fake override of original
This fixes a couple of verify errors related to the order of supertypes in the
class declaration
2013-12-09 17:59:58 +04:00