Commit Graph

95 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
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
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 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
Svyatoslav Kuzmich 9ef899ef10 [Wasm] Reuse Callable reference and SAM lowerings from JS 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
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
pyos 6c1a5e1211 JVM: make inline function argument processing a bit shorter 2021-06-16 12:13:32 +02:00
pyos 1181854bd6 Add a couple more tests for array constructors and references 2021-05-06 18:25:56 +03:00
pyos 9f53d70109 JVM_IR: move ArrayConstructor below function reference phases
This allows taking function references to inline array constructors.

Also, redundant classes are no longer generated when function references
are passed as arguments to the array constructors.

 #KT-46426 Fixed
2021-05-06 18:25:53 +03:00
Alexander Udalov 4fffed4165 Improve test on equals/hashCode for KProperty accessors
Remove duplication & unnecessary checks, check equality in both
directions, check hashCode, add more cases, rename variables for
clarity.

 #KT-13490
2021-04-19 20:39:54 +02:00
Xin Wang c959b271a4 Override "hashCode" and "equals" for Getter and Setter to fix KT-13490 2021-04-19 20:39:54 +02:00
Alexander Udalov 73aa465ee9 Add tests for issues fixed in JVM IR
Note that KT-30696 is fixed only in the single-module case, and KT-42012
is not fixed fully (see KT-44855).

 #KT-30041
 #KT-30629
 #KT-30696
 #KT-30933
 #KT-32351
 #KT-32749
 #KT-38849
 #KT-42012
 #KT-42990
 #KT-44234
 #KT-44529
 #KT-44631
 #KT-44647
2021-02-10 21:42:10 +01:00
Denis Zharkov d4c7d4fc7c FIR: Fix callable references resolution with stub receivers
Use stubReceiver as a receiver for fake calls

See issues KT-43358 KT-43359 KT-43378
2020-11-16 15:50:39 +03:00
Svyatoslav Kuzmich fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00
Jinseong Jeon 5f64d6ec76 FIR2IR: add support for callable reference to Java field
#KT-42656 Fixed
2020-10-15 08:47:46 +03:00
Jinseong Jeon bff36e0199 FIR2IR: convert annotations on FirTypeRef 2020-07-30 11:25:36 +03:00
Vitaly fe047f9b47 [JS BE] mutes tests for JS_IR_ES6, which muted for JS_IR 2020-05-27 00:32:56 +03:00
Denis Zharkov e1e149a062 FIR: Support coercion-to-unit semantics for callable references 2020-05-18 11:17:45 +03:00
Mikhail Glukhikh c6c848f929 Introduce & use FirJvmSerializerExtension & FirBasedClassCodegen
#KT-38156 In Process
2020-04-28 07:34:56 +03:00
Mikhail Glukhikh 96d8b0bea3 FIR: make KFunctionX derived from KFunction 2020-04-20 17:05:37 +03:00
Georgy Bronnikov 2c4fcebfec IR: handle adapted bound references 2020-04-18 20:31:57 +03:00
Juan Chen a1e0e8b0e7 [FIR] Handle receiver types of extension methods when computing maximally specific types.
Test case (from testPrimitiveReceiver):

fun Short.foo() = 3
fun Int.foo() = 4

1::foo
2020-04-15 11:16:33 +03:00
Dmitriy Novozhilov f7dc06a772 [FIR] Approximate integer constants in lhs of callable reference 2020-04-15 11:13:01 +03:00
Mikhail Glukhikh f374c36cd2 [FIR2IR] Generate property extension receiver references properly 2020-04-03 13:31:15 +03:00
Mikhail Glukhikh 282509b0da [FIR2IR] Provide object receivers for callable references 2020-03-31 20:27:24 +03:00
Mikhail Glukhikh 810b607a65 [FIR2IR] Provide receivers also for property callable references 2020-03-30 16:23:10 +03:00
Juan Chen d8539fdde9 [FIR2IR] Add dispatch & extension receivers to callable references 2020-03-30 16:23:10 +03:00
Igor Chevdar 90abf1fda0 [JS_IR] Don't capture the bound receiver of a CR 2020-03-28 15:26:19 +03:00
Mikhail Glukhikh 0f0e5e603d [FIR2IR] Use IR built-in types, their symbols & constructors directly 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh 20c4a7b244 [FIR2IR] Introduce staged transformation (first step)
Now FE IR -> BE IR transformation is performed in multiple stages
controller by Fir2IrConverter. Stages are
 * files & classes registration
 * supertypes & type parameters handling
 * functions & properties signature generation
 * body generation

After each step we have guarantee (with exception of local classes &
type inference combination, and external symbols) that required symbols
(class/function/property/variable/type parameter)
are already bound to real declarations and have correct parents.

This commit also fixes incorrect parents for local classes
2020-03-13 12:18:02 +03:00
Roman Artemev 161bb72439 [JS IR] Update test data 2020-03-03 18:54:36 +03:00
Roman Artemev e57d34dd9e Make fix test:
- [JS IR] Unmute fixed tests
 - [IrText] Update testdata
 - [WASM] Temporary turn wasm test off
 - [FirText] Temporary turn fit text tests off
 - [JVM IR] Turn off klib jvm test
 - [IR] Add new test
2020-02-14 18:22:17 +03:00
Mikhail Zarechenskiy 60a2d0f037 [NI] Approximate receivers for callable reference candidates
#KT-36221 Fixed
2020-01-31 18:26:32 +03:00
Mikhail Zarechenskiy ce690d8a1d Add test for obsolete issue
#KT-36121 Obsolete
2020-01-29 11:43:11 +03:00
Ilya Gorbunov 0f6df5971b Mute tests failing in JS_IR backend due to KT-35944 2020-01-16 15:36:16 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Steven Schäfer 62a1ea643a Add additional tests for bound receivers in callable references 2019-09-06 15:11:59 +02:00
pyos 54d1df3147 JVM_IR: fix unbound function references 2019-06-25 12:29:23 +02:00
Mikhael Bogdanov 81e6416bfe Support bound callable reference inlining in IR 2019-06-04 14:56:13 +02:00
Roman Artemev beb1ce55f8 [IR BE] Fix capturing of var-locals inside class/field initializers 2019-05-31 13:14:43 +03:00
Mikhael Bogdanov 4c59d161d4 Support basic reification in IR 2019-04-08 13:10:22 +02:00
pyos 8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
Svyatoslav Kuzmich aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00