Commit Graph

287 Commits

Author SHA1 Message Date
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
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 ab9a23cbfa [Wasm][Stdlib] Reuse K/N collections and StringBuilder 2021-10-01 17:18:49 +03:00
Victor Petukhov 43a83dd07a Don't add LHS type constraint for callable references too early, before the resolution
The constraint depends on a resolution candidate, because it can be Java static or companion object's member (don't need add constraint in this case)

^KT-41978 Fixed
2021-10-01 13:33:21 +03:00
Alexander Udalov dbd28142d0 Fix callable reference adaptation for vararg in fake override
`mappedVarargElements` are populated with parameters from
`argumentMapping`, which is computed using `ArgumentsToParametersMapper`
which calls `original` on all value parameters (see
ArgumentsToParametersMapper.kt:136).

So the code that adds empty lists for unassigned vararg parameters
should also call `original`. Otherwise, in the added test, we ended up
with two arguments for the parameter `s` in `id(::base1)`, one for
`Base.s` containing the correct value, and another for `Derived.s`
containing the empty list. Psi2ir took the last one, which resulted in
empty array being passed to the vararg parameter.

Note that all of this is caused by the fact that `original` of a fake
override parameter is the parameter of the base function. This seems
suspicious because `original` of a fake override _function_ is that fake
override itself (NOT the base function), but this would probably be very
risky to change at this point.

 #KT-48835 Fixed
2021-09-30 14:08:38 +02:00
Svyatoslav Kuzmich 5c05ff48ff [Wasm] Copy property reference lowering from K/N 2021-09-27 17:07:39 +03:00
Svyatoslav Kuzmich 6db7154876 [Wasm] Build bridges for non-virtual functions that implement interfaces 2021-09-22 19:49:43 +03:00
Igor Yakovlev 41a69ad388 [WASM] Add receiver capturing to callable references 2021-09-20 19:08:22 +03:00
pyos 8724bc9525 Add test for KT-48478 2021-09-15 13:23:11 +02:00
pyos 858bd47c45 JVM_IR: use substituted return type when lowering inline references
#KT-48267 Fixed
2021-08-20 06:41:03 +02:00
Mads Ager 608b88996a [JVM_IR] Fix inlining of callable references to extension methods.
Check directly that the referenced function is an extension
function instead of relying on the annotation on the type.

^ KT-47988 Fixed.
2021-08-11 13:29:11 +02:00
Mads Ager b51ff799cb Fix IteratorNext intrinsic to cast its dispatch receiver to
the expected type.

^KT-47741 Fixed.
2021-07-16 21:07:11 +02:00
Mikhael Bogdanov a657e63dbb Update test affected by ForbidUsingExtensionPropertyTypeParameterInDelegate feature 2021-07-16 13:26:35 +00:00
Igor Laevsky d835b3c164 WASM: Implement spread operator 2021-07-02 15:39:29 +03:00
pyos 6c1a5e1211 JVM: make inline function argument processing a bit shorter 2021-06-16 12:13:32 +02:00
Andrey Zinovyev ddc9c1bd1b [FIR] Fix extension property reference resolution
On type with star projection
#KT-44372 Fixed
2021-06-09 15:15:28 +03:00
Roman Artemev 5f65b46dfc [JS IR] Unmute fixed tests 2021-06-02 13:42:35 +03:00
pyos 5c2753b5d1 JVM_IR: use substituted return type in function reference invoke
#KT-46982 Fixed
2021-05-31 16:01:22 +03:00
pyos d37ceb47be JVM_IR: use correct dispatch receiver type in more references
#KT-46902 Fixed
2021-05-26 15:23:19 +02:00
Dmitry Petrov ba00709e4d JVM_IR KT-46839 lower varargs for *arrayOf function references 2021-05-21 22:06:52 +03:00
pyos b2ef854aa1 JVM_IR: support @JvmStatic transformations in LateinitLowering
#KT-46759 Fixed
2021-05-19 16:23:01 +03:00
pyos f1f13b6e97 JVM_IR: do not evaluate receiver of static calls if it is pure
#KT-46802 Fixed
2021-05-19 16:22:59 +03:00
pyos d5d6736e67 PSI2IR/FIR2IR: do not approximate T!! before translation
This leads to weird effects when it's in a contravariant position,
because it's approximated by Nothing.
2021-05-12 11:37:48 +03:00
pyos a37db99841 JVM_IR: remove a hack from InlineCallableReferenceToLambda
It breaks other things, the same problem is hit by FunctionReference,
and it's the translation layer's fault anyway.

 #KT-46555 Fixed
2021-05-12 11:37:47 +03: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
Mark Punzalan 9a4742c08d FIR: Properly build nullable suspend function types, and aggregate
modifiers and annotations within KtTypeReference/REFERENCE_TYPE nodes.
2021-04-26 15:11:38 +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
Abduqodiri Qurbonzoda d28d0a6321 Advance String(CharArray) deprecation level to ERROR in Common and JS 2021-04-07 00:23:29 +03:00
Alexander Udalov ce0c0ad2e3 JVM IR: get rid of toIrBasedKotlinType in MethodSignatureMapper
Commonize (in terms of TypeSystemCommonBackendContext implementations
for KotlinType/IrType) code that computes optimal TypeMappingMode to
apply to different positions where inline class types can be present.
2021-04-01 20:17:45 +02:00
Denis.Zharkov a130b110f1 FIR2IR: Fix incorrect conversion of adapted callable references with receiver 2021-03-31 15:57:02 +03:00
Dmitry Petrov d74168fb8f PSI2IR KT-44414 fix adapted reference to imported object member 2021-03-15 21:24:25 +03:00
Mads Ager 8852323a76 [PSI2IR] Do not generate property reference setter if inaccessible.
Fixes KT-45064.
2021-02-23 19:33:49 +01:00
Dmitry Petrov b1ab64e854 JVM_IR KT-44483 argument adaptation is already done in PSI2IR 2021-02-15 19:41:39 +03:00
Mikhail Glukhikh fa0f967c83 FIR2IR: support adapted references for constructors 2021-02-15 17:08:13 +03:00
Mikhail Glukhikh 8bab208322 FIR2IR: use information about callable reference adaptation from resolve 2021-02-15 17:08:08 +03: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
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
Dmitriy Novozhilov 606ae45f5f [Test] Replace remaining KOTLIN_CONFIGURATION_FLAGS directives with specific ones 2021-02-10 13:02:06 +03: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
Svyatoslav Kuzmich b6ad1584c9 [Wasm] Improve interface method dispatch
- Use typed Wasm tables for each interface method to avoid runtime
  function type check

- Use linear search by implemented interface rather than by individual
  virtual function signature
2020-12-30 19:29:10 +03:00
Dmitry Petrov 3f7a776fb8 JVM box tests for KT-21092 2020-12-23 21:50:07 +03:00
Dmitry Petrov 9f908cdf7c JVM box tests for KT-16752 2020-12-23 21:50:05 +03:00