Commit Graph

72 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
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
pyos 82ccf81da8 Fix this remapping in inner class constructors
Inner class constructors should use the argument instead of reading
outer `this` from a field because if such an access happens before a
delegating constructor call, e.g. when evaluating an argument, a JVM
bytecode validation error will be thrown. (The only operation on `this`
allowed before a delegating constructor call is SETFIELD, and only if
the field in question is declared in the same class.)
2019-03-19 09:20:41 +01:00
Alexander Udalov cca6ba38be Add tests for obsolete codegen issues
#KT-16790 Obsolete
 #KT-16858 Obsolete
 #KT-17441 Obsolete
2019-01-09 19:18:54 +01:00
Anton Bannykh 2e709a81fa [JS IR BE] Arrays, varargs 2018-09-18 14:36:20 +03:00
Roman Artemev 8a871b3f0c Update tests 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov 5c0cdac69f JVM_IR. Support generic constructors after "Roll back constructor type parameters" 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov bbc5fa4705 Perform InnerClassLowerings after CallableReferenceLowering 2018-08-09 14:22:51 +03:00
Mikhael Bogdanov 357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Mikhael Bogdanov 06b16a6459 Unmute ir-tests after prev commit 2018-08-09 14:22:46 +03:00
Mikhael Bogdanov 6c41f078a6 Mute jvm ir box tests 2018-08-02 13:19:28 +02:00
Svyatoslav Kuzmich 625983b28a [JS IR BE] Enum class lowering 2018-07-23 15:08:18 +03:00
Anton Bannykh ac1a97ad83 JS IR: unmute tests 2018-07-11 14:49:36 +03:00
Anton Bannykh 07b3b66fd9 JS IR: unmute tests 2018-07-10 13:34:19 +03:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00