Commit Graph

331 Commits

Author SHA1 Message Date
Denis.Zharkov 05ca001310 FIR2IR: Repeat the K1 behavior: SAM conversion with 'in' projection
It would be more consistently to prohibit the behavior from the unmuted
test (see KT-52428), but it was decided to postpone the breaking change.

Unfortunately, it didn't work to make a test where for computing
star projections we would need to substitute other type parameters
because effectively, it's not allowed to have SAM conversion when
star projections/wildcard is based on a type parameter which bounds
use other type parameters.

^KT-53552 In progress
2023-02-20 14:54:09 +00:00
Dmitriy Novozhilov aef9b129d2 [FIR] Add regression tests for number of issues fixed in K2
List of issues:
KT-4113,  KT-6822,  KT-7389,  KT-17817, KT-20223
KT-21463, KT-24503, KT-24737, KT-24779, KT-24901
KT-27261, KT-28668, KT-30497, KT-30756, KT-36958
KT-37365, KT-37490, KT-38288, KT-41038, KT-41721
KT-42136, KT-42169, KT-42449, KT-42715, KT-43553
KT-43603, KT-43846, KT-43936, KT-46288, KT-46301
KT-47373, KT-47484, KT-47490, KT-47495, KT-47750
KT-47815, KT-47870, KT-48975, KT-49024, KT-49045
KT-50134, KT-50160, KT-50550, KT-51045, KT-51143
KT-51796, KT-52262, KT-52424, KT-52860, KT-52934
KT-53086, KT-53494, KT-53671, KT-53752, KT-53819
KT-54478, KT-54518, KT-54931, KT-54990, KT-55138
KT-55379, KT-55555, KT-56243
2023-02-14 17:08:55 +00:00
Nikolay Lunyak a9343aeb7d [FIR] KT-55840: Ensure everything actually works
This inconsistency is present due to not using the `// WITH_STDLIB`
in the above tests. When K1 creates the enum, it tries to generate
`entries()`, and for that it tries to load `kotlin.enums.EnumEntries`,
but this is actually an unresolved reference. K1 silently swallows it,
and proceeds.

The reason K2 doesn't fail is that in order to generate `entries()` it
simply creates the necessary `ConeClassLikeType` with the desired
`classId` instead of loading the whole `ClassDescriptor`.

The reason we can still observe `$ENTRIES` and `$entries` in K1
is because they are generated during the JVM codegen, and it
only checks if the `EnumEntries` language feature is supported. It
doesn't check if the `entries` property has really existed in IR
(by this time it's expected to have already been lowered to the
`get-entries` function - that's why "has ... existed").

The reason why the codegen doesn't fail when working with
`kotlin.enums.EnumEntries` is because it creates its
own `IrClassSymbol`.

^KT-55840 Fixed

Merge-request: KT-MR-8727
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-02-10 16:57:51 +00:00
Dmitriy Novozhilov 075e025452 [FIR2IR] Properly generate GetObject expression for callable reference on companion object
^KT-55909 Fixed
2023-02-07 09:49:20 +00:00
Pavel Kunyavskiy cb655d2d37 [K/N] Fix work with adapted function references
Their parsing was totally incorrect for K2, and sometimes incorrect for
K1. After this commit it uses same code as for JVM.

^KT-55462
2023-01-30 19:44:49 +00:00
Mikhail Glukhikh f0a1d3e3b1 FIR2IR: generate modifiers in reference adapters as PSI2IR does
In particular, this commit makes isExternal, isExpect and isTailRec
always false for FIR2IR reference adapters

#KT-55461 Fixed
2023-01-25 12:31:34 +00:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Vladimir Sukharev 924898afb7 [K/N] KFC-446: K2 platform: Native alpha
Merge-request: KT-MR-7905
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-04 16:10:40 +00:00
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00
vladislav.grechko c990bbb26c Get rid of excess method in compiled inline class with custom equals
^KT-54501: Fixed
2022-10-21 12:57:11 +00:00
vladislav.grechko 70c2f2b86f Support specifying different bytecode listings for FIR and old frontend 2022-10-21 12:57:11 +00:00
Alexander Korepanov 01507281a2 [Common IR] Forward the extension receiver in the reified wrapper
^KT-53672 Fixed
2022-09-05 07:40:30 +00:00
Alexander Udalov 19bbcc5869 Do not generate metadata for callable reference classes
After an accidental change in 846537b367, we started generating metadata
into anonymous classes for callable references. This metadata contained
the Kotlin representation of the referenced function. In KT-53794, this
led to a problem where Java's protected visibility could not be
represented in Kotlin terms, which crashed the backend.

But also, this metadata is useless because there's no real use case for
interpreting it (since you already have a function reference object at
runtime with all the needed information), so it would take some extra
space in the bytecode.

 #KT-53794 Fixed
2022-09-01 12:15:25 +02:00
Mads Ager 59c2bde10a [K/N] Unmute passing tests. 2022-08-01 08:57:16 +00:00
Steven Schäfer 7d59c7689c JVM IR: Avoid direct invokes in callable reference tests
Due to the direct invoke optimization, most callable reference tests
were not generating callable references/lambdas.
2022-07-14 23:24:18 +02:00
Victor Petukhov 2057deb91b [FE 1.0] Create DONT_CARE type only for callable references with no expected type
Otherwise, it can be resolved safety

^KT-52270 Fixed
2022-07-11 12:44:06 +00:00
Victor Petukhov 0199c76c06 [FE 1.0] Check callable reference return type safety during resolution
^KT-51844
^KT-52503 Fixed
2022-05-27 13:56:34 +00:00
Victor Petukhov 51551998c7 Revert "[FE 1.0] Take care callable reference candidates with recursive candidate return type"
This reverts commit d04beaa8bb49c99ceb993f3f7b32169c393b39f4.
2022-05-27 13:56:33 +00:00
Victor Petukhov 9f31f074da [FE 1.0] Take care callable reference candidates with recursive candidate return type
^KT-51844 Fixed
2022-05-09 19:23:43 +00:00
Alexander Udalov 328853dffe Add tests for obsolete issues
(Test for KT-37331 is added to multiplatform/defaultArguments/suspend.kt.)

 #KT-30080
 #KT-33641
 #KT-36237
 #KT-36952
 #KT-37331
 #KT-38920
 #KT-39256
 #KT-42415
 #KT-44636
 #KT-45704
 #KT-47084
 #KT-47894
2022-03-08 14:19:37 +01:00
Ivan Kochurkin ed836f28f4 [FIR2IR] Function reference type approximation hack KT-49526 2022-01-21 19:34:11 +03:00
Pavel Kunyavskiy afc548d5d9 [K/N] Fix equality on fun-interface constructor references
^KT-50204
2022-01-13 09:45:58 +00:00
Pavel Punegov c4619b4871 [K/N][test] Ignore tests that fail due to the init order
These test run correctly in the new MM
2022-01-10 09:01:06 +00:00
Pavel Punegov 0fadf14502 [K/N][test] Ignore test ^KT-50399 2022-01-10 09:01:04 +00:00
Ivan Kochurkin 58dfe3d804 [FIR2IR] Reify type parameters for callee reference with vararg 2021-12-21 19:10:41 +03:00
Dmitry Petrov 976998b56c PSI2IR KT-49526 function reference type approximation hack 2021-12-17 21:06:24 +00:00
Victor Petukhov e50e055eb4 [FE 1.0] Don't try to compute value parameters for variables while creating a flat signature for the overload resolution
^KT-50172 Fixed
2021-12-16 17:46:01 +03:00
Ivan Kochurkin 522d2064bb [FIR2IR] Initialize fake overrides for callable references 2021-12-09 12:31:24 +00:00
Mikhail Glukhikh 8c7f659a32 Black box: drop WITH_RUNTIME or replace with WITH_STDLIB 2021-12-09 13:26:38 +03:00
Dmitry Petrov 93713a9ad4 JVM_IR KT-47939 use FunInterfaceConstructorReference as base class 2021-12-08 14:12:41 +03:00
Dmitry Petrov 0ccd7a7e0c KT-47939 fun interface constructor reference should throw NPE for null 2021-12-08 14:12:41 +03:00
Dmitry Petrov e5eee9bab9 KT-47939 KotlinFunInterfaceConstructorReference is experimental 2021-12-08 14:12:40 +03:00
Dmitry Petrov 72f7276f3c PSI2IR KT-47939 more tests 2021-12-08 14:12:40 +03:00
Dmitry Petrov 9eeb8f54fb JVM_IR KT-47939 fixes after review 2021-12-08 14:12:39 +03:00
Dmitry Petrov e179598457 JVM_IR KT-47939 equality for fun interface constructor references 2021-12-08 14:12:38 +03:00
Dmitry Petrov 50b0dae786 KT-47939 fixes after review 2021-12-08 14:12:37 +03:00
Dmitry Petrov 58f1504aaf KT-47939 basic fun interface constructor reference box test 2021-12-08 14:12:37 +03:00
Igor Yakovlev ea060dcf8a [WASM] Implement lazy with UnsafeLazyImpl 2021-12-07 21:33:34 +03:00
Igor Yakovlev 4f9b54da26 [WASM] Remove ignore from wasm std text tests 2021-12-07 21:33:28 +03:00
Mikhail Glukhikh cf104c8433 FIR: add status line to all failing black box tests 2021-11-20 03:37:31 +03: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
Igor Yakovlev ce360bb10b [WASM] Implementation of Class references 2021-11-15 19:53:46 +03:00
Alexander Udalov 1071919706 Remove backend tests on old inference
Also remove any mentions of NewInference, and rename some tests.
2021-11-09 20:07:33 +01:00
Igor Laevsky e331a52e75 [Wasm] Mute/unmute box tests after kotlin.test support 2021-10-14 17:24:05 +03:00
Dmitry Petrov 6ba65065ee JVM add tests for KT-48544 & KT-49226 2021-10-14 17:23:12 +03:00
Svyatoslav Kuzmich 15acc412ba [Wasm] Update testdata after coroutines support 2021-10-12 08:42:00 +03:00
Svyatoslav Kuzmich 9ef899ef10 [Wasm] Reuse Callable reference and SAM lowerings from JS 2021-10-08 07:24:41 +03:00
Svyatoslav Kuzmich 1ed2748334 [Wasm] Generate [K][Suspend]FunctionN on demand and support big arity 2021-10-08 07:24:41 +03:00
Svyatoslav Kuzmich aa5f98f919 [JS] Remove KJS_WITH_FULL_RUNTIME for tests that already have WITH_RUNTIME 2021-10-07 22:36:18 +03:00