Commit Graph

151 Commits

Author SHA1 Message Date
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
Mikhail Glukhikh 6d642c88f5 FIR2IR: make enum with abstract members from interfaces abstract
Related to KT-55828
2023-02-02 10:53:20 +01:00
Vladimir Sukharev fbcb07d375 [K2/N] KT-55828 Enable already fixed and accidentally disabled tests
Merge-request: KT-MR-8605
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-01 10:44:26 +00:00
Dmitriy Novozhilov 88efa6bfb6 Update tests after switching to LV 1.9 2023-01-30 09:29:57 +00:00
Vladimir Sukharev ff6ea40056 KT-55828: Disable failed tests for K2 Native in OPT mode
Merge-request: KT-MR-8229
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-09 15:09:04 +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
Ivan Kochurkin 8883de3f00 [FIR] Don't resolve Enum.declaringClass and Enum.getDeclaringClass
^KT-53946 Fixed
2022-11-23 18:29:29 +00:00
Ilya Chernikov 7e4ee399c8 FIR JS: temporarily mute remaining codegen tests 2022-11-12 16:28:25 +01: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 4e4511bba2 FIR2IR: convert enums with non-primary default ctor correctly
see added test for example
2022-11-12 16:28:24 +01:00
Ilya Chernikov 44cce3ad52 FIR JS: mute remaining tests for now 2022-11-12 16:28:23 +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
Artem Kobzar 8b826a865b [K/JS, K/WASM] feat(Enum.entries): add support of new enum static field for JS and WASM. 2022-08-29 16:04:12 +00:00
Pavel Kunyavskiy 895a8ff149 [K/N] Basic support of Enum.entries for Native
No forward compatibility yet, with old klib IR linker will fail.

^KT-53324
2022-08-25 12:40:30 +00:00
Vsevolod Tolstopyatov e3bff290bd [JVM] Lower .entries calls on Kotlin enums
Leveraging the same mechanism with $EntriesMapping as Java enums.
Old (compiled with LV/AV < 1.8) enums are detected by looking for
static special <get-entries> method that cannot be introduced on
Kotlin enums otherwise

#KT-53236
2022-08-12 09:35:22 +00:00
Vsevolod Tolstopyatov a12a31ce68 [JVM] Lower .entries calls on Java enums
#KT-53236
2022-08-12 09:35:21 +00:00
Vsevolod Tolstopyatov e708809e55 [JVM] Support Enum.entries for enums being compiled with Kotlin 1.8+
#KT-53236
2022-08-12 09:35:20 +00:00
Mads Ager 59c2bde10a [K/N] Unmute passing tests. 2022-08-01 08:57:16 +00:00
Mikhail Glukhikh 983fa4c8c7 FIR: add temporary access to Enum.getDeclaringClass (see KT-49653) 2022-01-27 17:27:39 +03:00
Igor Yakovlev e58d4163ad [WASM] Add std methods for collections 2022-01-05 13:12:32 +01:00
Mikhail Glukhikh 0058d7e3d6 Add BB test for problem fixed with c2ab91d0 2021-11-24 15:30:33 +03:00
Dmitry Petrov 2179987de7 FIR2IR fix enum special methods generation 2021-11-23 06:34:33 +00: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
Sergej Jaskiewicz 9e5520bba8 [JS IR & WASM] Fix executing init blocks for enums with nested objects 2021-10-18 13:37:16 +00:00
Svyatoslav Kuzmich 3f8dce4b53 [JS IR] Support per-file mode and ES modules 2021-10-12 23:29:39 +03:00
Artem Kobzar dca4a8e722 fix(KT-45056, KT-47516): use enum as an IR class instead of enum entity class. 2021-10-08 16:21:49 +00: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
Svyatoslav Kuzmich 6eb81517a0 [Wasm] Unmute passed Wasm tests 2021-10-02 06:14:35 +00:00
Svyatoslav Kuzmich c88cde2f8b [Wasm] DONT_TARGET_WASM_BACKEND => IGNORE_BACKEND in testdata 2021-10-02 06:14:35 +00:00
Svyatoslav Kuzmich 5c05ff48ff [Wasm] Copy property reference lowering from K/N 2021-09-27 17:07:39 +03:00
Igor Yakovlev 41a69ad388 [WASM] Add receiver capturing to callable references 2021-09-20 19:08:22 +03:00
Igor Laevsky 00f61978b8 WASM: Enable exception handling tests 2021-09-08 19:56:38 +03:00
Igor Laevsky d99473fe4d WASM: Canonicalize catches without finally blocks 2021-09-08 19:56:35 +03:00
Roman Artemev 09d30c91bf [JS TESTS] Disable mangler checker in tests 2021-07-01 17:40:41 +03:00
pyos 26e3237b8c JVM_IR: never rename public/protected fields
And if that causes a platform declaration clash, that's not a problem
that can be solved without breaking the ABI anyway.

 #KT-47412 Fixed
2021-06-24 17:41:06 +03:00
Steven Schäfer 60bc0f4baf IR: Lower shared variables in enum entries (KT-46605) 2021-05-18 16:55:38 +02:00
Steven Schäfer 6aaff9dfb7 JVM IR: Handle overloaded values functions in MappedEnumWhenLowering
Fixes KT-46579.
2021-05-13 13:24:32 +02:00
Igor Chevdar 7dcdbf283b [box-tests] Added test 2021-04-26 11:53:27 +05:00
Andrey Zinovyev 27766c2575 [FIR] Consistent isLocal for objects inside Enum entries 2021-04-20 18:12:51 +03:00
pyos cc7187e49b JVM_IR: cast argument of enumValueOf to String in bytecode
Generic functions and implicit casts may return a supertype instead.

 #KT-45865 Fixed
2021-04-13 13:24:24 +02:00
Dmitry Petrov e630e00e99 JVM_IR KT-44744 check accessibility of enum entry 'this' 2021-03-15 17:26:49 +03:00
Alexander Udalov 510b9e6f2a Move around some codegen box tests
In tests merged from boxAgainstJava in 29b96aa1, some directories were
named slightly differently compared to box, e.g. "property" vs
"properties", "varargs" vs "vararg". This change renames these, moves
some of the tests to more fitting directories, and also renames
"visibility" to "javaVisibility" because it's about Java visibilities
specifically.
2021-02-11 13:50:09 +01:00
Alexander Udalov 401f0ac583 Use TARGET_BACKEND instead of DONT_TARGET_EXACT_BACKEND in box against Java tests
"// TARGET_BACKEND: JVM" more clearly says that the test is
JVM-specific, rather than DONT_TARGET_EXACT_BACKEND which excludes all
other backends.
2021-02-11 13:50:08 +01:00
Dmitriy Novozhilov 29b96aa15d [Test] Properly merge box against java testdata into codegen/box
Previous commit about it was 3199ce03 and it was completely wrong
2021-02-04 10:53:50 +03:00
Mikhael Bogdanov 1c612376dd Disable some android box test 2021-01-28 18:30:48 +01:00
Mikhail Glukhikh 9a5791ad6d FIR: use correct context for enum entry resolve
Now the same resolve context is used for enum entries and
for constructors.
2021-01-18 08:34:46 +03:00
Jinseong Jeon 7cc06489dd IR: move enum value array initialization out of <clinit>
#KT-44192 Fixed
2021-01-07 23:00:37 +01:00
Jinseong Jeon f8f08e8134 IR: add a test about maximum number of constants in an enum class 2021-01-07 23:00:37 +01:00
Shagen Ogandzhanian e7dc199ad7 Init enum entries whenever we access companion object or accessing valueOf
Fixes https://youtrack.jetbrains.com/issue/KT-43987
Fixes https://youtrack.jetbrains.com/issue/KT-43989
2020-12-30 14:54:34 +01:00