Commit Graph

8267 Commits

Author SHA1 Message Date
Nikita Nazarov 251fdb21c9 [FIR] Generate spread element for unsigned arrays
Previously when unsigned arrays were passed as vararg in a named form the necessary spread element wasn't generated, which resulted in a compilation error.

^KT-63514 fixed
2023-12-13 15:30:27 +00:00
Mikhail Glukhikh dbca7358af K2: add explicit cast to Any for Any function calls on stub types
This commit solves a stub type inconsistency problem.
As a part of KT-59369 fix we decided (see commit 299d2799),
that ConeStubTypeForChainInference has a scope of Any,
so we can safely resolve only to equals/hashCode/toString.
However, later we can replace a stub type with some inferred type,
which can have its own equals/hashCode/toString implementation,
while the call still refers Any member.
In this situation FIR2IR decides that we are calling a fake override,
which is not true, in fact we are calling an overriding method.
This leads to a crash in Native backend.

To solve this situation, we provide an explicit cast of a dispatch
receiver with a stub type (ConeStubTypeForChainInference) to Any,
thus confirming directly we are calling Any method and nothing else.

#KT-63932 Fixed
2023-12-13 14:56:58 +00:00
Kirill Rakhman 6d1ca3d379 [FIR] Fix CCE in deserialization of suspend function type with star projection continuation
#KT-64148 Fixed
2023-12-13 14:36:01 +00:00
Svyatoslav Kuzmich 76e132e758 [Wasm] Fix overloading virtual methods by vararg and array element type
Context:
- Kotlin allows functions overloaded with different array element types.
- Varargs are lowered to Array parameters.
- Before this commit, K/Wasm erased an array element type
  from the signature, similar to type argument erasure in other cases.

Fix:
Stop erasing type arguments in arrays when computing v-table signatures.

^KT-58852 Fixed
2023-12-13 13:30:50 +00:00
Dmitriy Novozhilov 93563d7c80 [FIR] Report PROPERTY_AS_OPERATOR for all operator conventions
^KT-62347 Fixed
^KT-59715 Fixed
2023-12-13 09:27:14 +00:00
Ivan Kylchik 97ba3fe396 [K2] Revert changes done in KT-61786
Changes in this ticket remove type enhancement in java fields
for K2. But after KT-61920 fix, we can actually support it.
2023-12-12 13:54:31 +00:00
Dmitriy Novozhilov 4a2f9a5123 [FIR] Mute some tests back due to KT-64081
They were accidentally fixed with `[FIR] Process all overridden members from intersection scopes`
  commit, which itself introduced incorrect behavior, which was properly
  fixed with ... commit. So KT-64081 started to appear again
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov 385bff3be1 [FIR] Update all required places according to changed overridden processing contract
This commit fixes all places that relied on the contract described in
  the previous commit and also updates corresponding tests

^KT-63738
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov 4272f2e156 [FIR] Process all overridden members from intersection scopes
Previously, there was a contract that each callable symbol in the chain
  of `processDirectOverriddenWithBaseScope` will be unique. And if some
  symbol is accessible from multiple scopes, then only last of them will
  be returned as a component of `MemberWithScope`

But after the change from previous commit, we don't have this contract anymore.
  Which means that we may meet the same symbol during processing hierarchy
  of overridden functions (but with different base scopes)

So if some code utilizes `process...Overridden...WithBaseScope` functions
  it should consider that the same symbol may be obtained several times

^KT-63738 Fixed
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov a15057b2ca [FIR2IR] Unwrap only call-site overrides during delegated members generation
^KT-60251 Fixed
2023-12-08 15:19:55 +00:00
Brian Norman 0881910a1b [FIR] Rewind DFA after call arguments for correct receiver smartcasting
^KT-63709 Fixed
2023-12-08 14:32:22 +00:00
Dmitriy Novozhilov 7d685522ce [IR] Fix calculation of receiver type for properies in expect/actual context
^KT-62926 Fixed
2023-12-08 13:28:27 +00:00
Evgeniy.Zhelenskiy 9cef8a2133 [FIR, Tests] Add box tests to verify that disappeared DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE leads to executable code
#KT-59903


Merge-request: KT-MR-13423
Merged-by: Evgeniy Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>
2023-12-08 13:18:59 +00:00
Dmitriy Novozhilov 58678c09e8 [FIR2IR] Include generated IR fields into Fir2IrCommonMemberStorage
In case of HMPP structure with common JVM module (e.g. shared between
  JVM and Android) one can reference the same field from java code,
  so it should be shared between fir2ir sessions

^KT-63574 Fixed
2023-12-08 11:16:03 +00:00
Artem Kobzar 2eb1e65bbf [K/Wasm] Allow to export unsigned numbers 2023-12-08 09:06:19 +00:00
Xin Wang 11749d7c89 [Codegen][JVM]: Mark line number before invoking intrinsics
Fixes #KT-61768
2023-12-07 11:54:12 +00:00
Kirill Rakhman 2391f00b75 [FIR2IR] Fix SAM conversion of adapted callable reference
#KT-63329 Fixed
2023-12-06 09:02:04 +00:00
Mikhail Glukhikh 4b649cbbe9 [tests] Drop a BI codegen test for should-be-red issue KT-63648 2023-12-05 18:15:53 +00:00
Mikhail Glukhikh 254bcdc80a [tests] Change builder inference tests in accordance with KT-53749 changes 2023-12-05 18:15:53 +00:00
Stanislav Ruban 7515efc52c [tests] Change builder inference tests in accordance with new K2 BI diagnostics
Related to KT-59369, KT-59390
2023-12-05 18:15:53 +00:00
Stanislav Ruban 4f38d77fae [tests] Add test data for KT-63840 2023-12-05 18:15:52 +00:00
Stanislav Ruban 2bcaa3eb8f [tests] Add test data for KT-63733 2023-12-05 18:15:52 +00:00
Stanislav Ruban a836e94619 [tests] Add test data for KT-63648 2023-12-05 18:15:52 +00:00
Stanislav Ruban 4671a9612a [tests] Add test data for KT-61310 2023-12-05 18:15:52 +00:00
Stanislav Ruban 7dc3ed61c0 [tests] Add test data for KT-60447 2023-12-05 18:15:52 +00:00
Stanislav Ruban 7a254cab9a [tests] Add test data for KT-60291 2023-12-05 18:15:51 +00:00
Stanislav Ruban e5642d83aa [tests] Add test data for KT-59798 2023-12-05 18:15:51 +00:00
Stanislav Ruban 4676b8a2ca [tests] Add test data for KT-59426 2023-12-05 18:15:51 +00:00
Stanislav Ruban f90bd8821c [tests] Add test data for KT-57834 2023-12-05 18:15:51 +00:00
Stanislav Ruban e3fce848b4 [tests] Add test data for KT-57709 2023-12-05 18:15:51 +00:00
Stanislav Ruban 55485a8fd6 [tests] Add test data for KT-57707 2023-12-05 18:15:51 +00:00
Stanislav Ruban 2226486152 [tests] Add test data for KT-56949 2023-12-05 18:15:51 +00:00
Stanislav Ruban 4021e022b7 [tests] Add test data for KT-55281 2023-12-05 18:15:51 +00:00
Stanislav Ruban 6532eb4c60 [tests] Add test data for KT-55057 2023-12-05 18:15:51 +00:00
Stanislav Ruban bb054f75b5 [tests] Add test data for KT-55056 2023-12-05 18:15:51 +00:00
Stanislav Ruban ddb7c6cff8 [tests] Add test data for KT-54767 2023-12-05 18:15:51 +00:00
Stanislav Ruban f600e1f591 [tests] Add test data for KT-54664 2023-12-05 18:15:51 +00:00
Stanislav Ruban 205d568545 [tests] Add test data for KT-54400 2023-12-05 18:15:51 +00:00
Stanislav Ruban 126022a80d [tests] Add test data for KT-53740 2023-12-05 18:15:51 +00:00
Stanislav Ruban 7d040af24c [tests] Add test data for KT-53639 2023-12-05 18:15:51 +00:00
Stanislav Ruban 9dd3cf7bfc [tests] Add test data for KT-53553 2023-12-05 18:15:51 +00:00
Stanislav Ruban 982e8133ba [tests] Add test data for KT-53422 2023-12-05 18:15:50 +00:00
Stanislav Ruban 96e12584a1 [tests] Add test data for KT-53109 2023-12-05 18:15:50 +00:00
Stanislav Ruban 385b29f9c2 [tests] Add test data for KT-52838 2023-12-05 18:15:50 +00:00
Stanislav Ruban f6a3f999c3 [tests] Add test data for KT-52757 2023-12-05 18:15:50 +00:00
Stanislav Ruban 50e58c00ea [tests] Add test data for KT-50827 2023-12-05 18:15:50 +00:00
Stanislav Ruban de8f0c157e [tests] Add test data for KT-50453 2023-12-05 18:15:50 +00:00
Stanislav Ruban 9de8d020f1 [tests] Add test data for KT-49263 2023-12-05 18:15:50 +00:00
Stanislav Ruban 2a257091fb [tests] Add test data for KT-49160 2023-12-05 18:15:50 +00:00
Stanislav Ruban cef44cfa7d [tests] Add test data for KT-47989 2023-12-05 18:15:50 +00:00