Commit Graph

85 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 5b01396a11 [FIR] Carefully process constructors of inner and nested classes in the tower
If there is an expression receiver, we should process constructors only
  of inner classes. Constructors of nested classes can be called only
  on classifier

^KT-65333 Fixed
2024-02-28 08:08:32 +00:00
vladislav.grechko 54858c2118 [FIR] Fix naming of local classes when serializing metadata
^KT-63655: Fixed
^KT-63901: Fixed
^KT-63988: Fixed
2024-02-07 12:30:50 +00:00
Alexander Korepanov f5d0c22736 [K2 JS] Unmute and link to issue some JS K2 tests 2024-01-18 15:48:55 +00:00
strangepleasures bb8ff9e299 KT-62584 Fix generation of type arguments for local classes
Merge-request: KT-MR-13684
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-01-10 14:20:09 +00:00
vladislav.grechko 34bac48541 Add JVM ABI K1/K2 consistency tests 2023-12-26 10:18:19 +00:00
Kirill Rakhman 11ab90ecbd [Tests] Add regression test for #KT-63732 2023-11-23 14:24:47 +00:00
Artem Kobzar 08bd0d6ce1 [K/JS] Generate tests for K2 + ES-classes compilation 2023-08-01 09:16:20 +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
Pavel Kunyavskiy 2f3947d8e5 [K/N] Unmute some actually passing tests 2023-05-09 09:15:41 +00:00
Ivan Kylchik ac480e2285 [K2] Support serialization of complex annotations
#KT-57611 Fixed
2023-04-07 18:07:09 +00:00
Dmitriy Novozhilov 92a59279d5 [FIR] Properly implement serializer extension for klib compilation
^KT-57654 Fixed
2023-04-05 07:31:33 +00:00
Ivan Kylchik 32297c0f21 Serialize and deserialize const val's properly for K2 klib
#KT-57312 Fixed
2023-04-04 12:35:54 +00:00
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +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
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 7e4ee399c8 FIR JS: temporarily mute remaining codegen tests 2022-11-12 16:28:25 +01:00
Ivan Kochurkin 0ef043b074 [FIR2IR] Consider property init value from nested class, ^KT-52057 Fixed 2022-05-29 23:41:23 +03:00
Dmitry Petrov 7206c06d26 IR KT-50039 don't initialize outer 'this' in delegating constructor 2021-12-06 17:31:37 +03:00
Victor Petukhov 80312789b2 [PSI2IR] Use candidate descriptor to get original type parameters while generating assignment receiver for property
^KT-46829 Fixed
2021-09-30 20:08:44 +03:00
Dmitry Petrov 851980e36f JVM_IR KT-45103 optimize direct invoke for lambdas and callable refs 2021-05-18 22:20:12 +03:00
Ilya Goncharov 88abb3d6c9 [JS IR] Fix creating of classes extended from nested one
[JS IR] Extract getClassRef method

 ^KT-44950 fixed
2021-03-18 21:14:00 +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
Roman Artemev 94acfa50bd [IR BE] Remap dispatch receiver for inner ctor too
- do not forget to add into mapping dispatch receiver
 - fix KT-40686 (at least part of it)
 - add test
2020-11-10 11:06:11 +03:00
Roman Artemev a52e045c91 [IR BE] Remap references in default arg value in inner class constructor
Make sure that there is no reference into zombie declarations.

 - fix KT-40771
 - add test
2020-10-06 00:06:47 +03:00
Steven Schäfer b02f0f0a25 JVM IR: Fix compilation of nested inner classes 2020-08-28 20:03:19 +02:00
Steven Schäfer 03651f1dd4 IR: Fix inner class type parameters in IrTypeSystemContext 2020-06-17 22:10:00 +03:00
Denis Zharkov 5bb0085f7e FIR: Fix test data after adba0a03a6 2020-05-27 10:29:46 +03:00
Juan Chen adba0a03a6 [FIR] Create builtin primitive array types for properties
If the primary constructor has a vararg parameter, the corresponding
property has an array type. This commit creates the builtin array
types for such properties if the vararg element type is primitive,
e.g., CharArray instead of Array.
2020-05-26 14:08:47 +03:00
Mikhail Glukhikh 7818baff1e [FIR2IR] Fix problem with double-generation of local class members 2020-05-26 11:50:33 +03:00
Juan Chen 858731cac8 [FIR] add support for varargs in delegated constructor calls
Also add support for spread operators as named arguments.
2020-05-14 13:42:07 +03:00
Mikhail Glukhikh 457fb09e3a [FIR] Use tower to resolve delegated constructors, set dispatch receiver 2020-05-12 16:57:07 +03:00
Jinseong Jeon ef09850df8 FIR2IR: set superQualifierSymbol for super call 2020-04-27 11:50:26 +03:00
simon.ogorodnik 132c8ee210 [FIR] Apply GOOD testData changes after type parameters support 2020-04-13 20:26:18 +03:00
Juan Chen e954aea4cc [FIR2IR] Support argument reordering of constructor calls 2020-04-13 17:09:04 +03:00
Mikhail Glukhikh e1c78b31a6 [FIR2IR] Convert explicit receiver in advance 2020-04-10 14:49:27 +03:00
Mikhail Glukhikh a0978a50e8 [FIR2IR] Correct 'this' conversion when it points to non-closest class 2020-03-30 16:57:52 +03:00
Mikhail Glukhikh 697006d782 [FIR2IR] Re-use receiver application logic in callable ref conversion 2020-03-30 16:23:10 +03:00
Mikhail Glukhikh 1812b490a1 FIR: set anonymous object constructor return type properly 2020-03-11 16:01:57 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh cfa626ad77 FIR2IR: introduce conversion scope, remove dispatch receiver for lambdas 2020-03-04 16:55:31 +03:00
Mikhail Glukhikh 2308e5bb7c FIR2IR: in case of use-site generic type use call from original class 2020-02-28 15:29:02 +03:00
Mikhail Glukhikh 8c155578f7 FIR2IR: generate both dispatch & extension receiver without 'else if' 2020-02-25 12:13:42 +03:00
Mikhail Glukhikh 39bd97147f [FIR] Don't create initializers for simple enum entries
Usually FIR enum entry is initialized by anonymous object,
which is the container for all enum entry' declarations.
However, for simple enum entries there is no need of initializer at all.
2020-02-21 16:38:52 +03:00
Juan Chen 573188bdc4 [FIR2IR]: fix translation of this references in instance methods
Currently FirThisReceiverExpression of instance methods are translated
to references of the class' thisReceiver,
not the method's dispatch receiver,
which causes problems with IrFrameMap::typeOf,
as the class' thisReceiver is not in the typeMap.

This commit translates non-qualified "this" references of
instance methods to references of the methods' dispatch receiver.
2020-01-10 10:43:07 +03:00
Mikhail Glukhikh 15f373a864 FIR2IR: support object receiver case (this fixes 24 black box tests) 2019-12-27 13:46:05 +03:00
simon.ogorodnik 5e426fdc71 [FIR] Optimization & checking fix: remove usage of dispatchReceiverValue 2019-12-27 13:45:59 +03:00
Dmitriy Novozhilov b76c984b26 [FIR] Support IntegerLiteralTypes 2019-12-09 17:24:26 +03:00
Mark Punzalan 5afab1ac2b [FIR] FIR2IR: Populate calls with type arguments and function type
parameters with bounds/supertypes.
2019-11-25 09:37:47 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
pyos 432ba62143 JVM_IR: omit annotations on outer this parameters 2019-10-08 14:41:05 +02:00