Commit Graph

405 Commits

Author SHA1 Message Date
Ilmir Usmanov 00a08fc6a4 Minor. Add tests and comment about copying generic parameters to
constructor, but not function reference to the constructor.

 #KT-32162
2022-02-15 08:11:19 +01:00
Ilmir Usmanov 84ccf412cb Minor. Ignore some tests on old JVM, JS_IR, JS and WASM
#KT-32162
2022-02-15 08:11:18 +01:00
Ilmir Usmanov 2fedb97d16 Correctly map nullable generic underlying value of inline class
if upper bound is primitive type.
 #KT-32162
2022-02-15 08:11:17 +01:00
Ilmir Usmanov a7e2f7a6b6 Map nullable type parameter with nullable inline class upper bound
which, in turn, has primitive or nullable underlying type to inline
class.
 #KT-32162
2022-02-15 08:11:15 +01:00
Ilmir Usmanov cece7120df Minor. Add more tests 2022-02-15 08:11:13 +01:00
Ilmir Usmanov c8817893d4 Support default parameters of inline type with generic underlying value
#KT-32162
2022-02-15 08:11:11 +01:00
Ilmir Usmanov 4f95171472 Minor. Add tests 2022-02-15 08:11:10 +01:00
Ilmir Usmanov 909b455758 Support generic underlying type of inline class in FIR
#KT-32162
2022-02-15 08:11:09 +01:00
Ilmir Usmanov 9060168542 Support generic underlying type of inline class
Use upper bound in JVM representation.
 #KT-32162
2022-02-15 08:11:08 +01:00
Ilmir Usmanov 8f23fc54a4 Mangle bridges if its return type is not inline
#KT-51235 Fixed
2022-02-14 13:06:13 +01:00
Ilmir Usmanov 47ee0e5b0a Get type arguments from supertype in supercall
Otherwise, when the function has inline class parameter, we get ICE.
We do not get the error without inline class parameter, since we
substitute type parameters in limited situations, which includes
inline class lowering.

 #KT-51157 Fixed
2022-02-10 10:40:55 +01:00
Igor Yakovlev 81c688b207 [WASM] Unmute passing test 2022-02-03 21:25:58 +01:00
Ilmir Usmanov b794b0f1be Check if there is bridge by signatures instead of IR
#KT-50649 Fixed
2022-01-18 16:57:00 +03:00
Igor Laevsky cfcbe9e1e2 [Wasm] Better preserve IR types after inlining 2022-01-01 20:04:44 +02:00
Ilmir Usmanov 549ea1a3b9 If fun interface methods are already mangled, do not mangle them twice
There are two possible scenarios, when fun interface method with inline
class parameter can be compiled.

First is when we compile fun interface itself before SAM adapter. In
that case, fun interface is lowered before we lower SAM adapter. Thus,
its method is mangled and mangling in the second time is an error.

Second is when we compile SAM adapter before the fun interface. In that
case, fun interface is not lowered, and we have to mangle the method.

The only way to distinguish there two cases I can think of is to check
whether the overridden method is already mangled, in other words, check,
whether the overridden method's suffix is doubled.

 #KT-48499: Fixed
2021-12-28 17:35:12 +01:00
Evgeniy.Zhelenskiy 610429a278 [Tests] Move non-value class test to the corresponding folder 2021-12-24 00:26:18 +00:00
Evgeniy.Zhelenskiy ec2e96f3e4 Regenerate inline class tests as 1 arg value classes 2021-12-15 17:14:22 +00:00
Dmitry Petrov df460a842b JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter 2021-12-13 14:13:34 +00:00
Dmitry Petrov 6f148c594f Revert "JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter"
This reverts commit 627d838343.
2021-12-13 14:13:33 +00:00
Dmitry Petrov 627d838343 JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter 2021-12-11 08:04:26 +00:00
Evgeniy.Zhelenskiy cb4ec932d7 [Tests] Introduce replacing source transformer 2021-12-10 18:19:17 +03:00
Evgeniy.Zhelenskiy f0af2487c7 [Tests] Replace @JvmInline with actual OPTIONAL_JVM_INLINE_ANNOTATION 2021-12-10 18:19:16 +03:00
Evgeniy.Zhelenskiy 96334948f0 [Tests] Pass sample test without annotation with flag ValueClasses 2021-12-10 18:19:15 +03:00
Evgeniy.Zhelenskiy f92290dfdf [Tests] Generate runTest with transformer parameter + example 2021-12-10 18:19:15 +03:00
Ilmir Usmanov f95cba0ec3 Support delegation by interface for inline classes in FIR
#KT-27435 Fixed
2021-12-08 00:11:55 +01:00
Ilmir Usmanov bb53ba4a2e Enable delegation by interface for inline classes in old FE
#KT-27435
2021-12-08 00:11:54 +01:00
Igor Yakovlev ea060dcf8a [WASM] Implement lazy with UnsafeLazyImpl 2021-12-07 21:33:34 +03:00
Igor Yakovlev 4f9b54da26 [WASM] Remove ignore from wasm std text tests 2021-12-07 21:33:28 +03:00
Ilmir Usmanov 8e8a6e6108 Do not count receivers in default parameters mask
If we implement default function with default parameters in inline
class, the receivers will be added to parameter list
(see ac7538a269). But since they
are not present in source parameters, we should not count them when we
compute mask for default parameters.

 #KT-49977 Fixed
2021-11-30 15:09:16 +00:00
Mads Ager 09da67767e [JVM_IR] Fix mangling of inline class inherited interface methods.
^KT-49864 Fixed
2021-11-30 03:33:56 +03: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
Steven Schäfer a6dae0b37b JVM IR: Fix value class mangling in SAM wrappers from different modules
KT-49659
2021-11-14 21:52:39 +01:00
zhelenskiy c1dc1f7e33 Diagnostics renamed
Signed-off-by: zhelenskiy <zhelenskiy2000@yandex.ru>
2021-11-13 12:38:45 +01:00
Ivan Kylchik edd608446e [TESTS] Move WITH_RUNTIME directive to file level 2021-11-08 23:50:34 +03:00
Igor Laevsky 0915dac1f9 [Wasm] Handle unsigned arrays in the vararg lowering 2021-11-03 18:50:06 +03:00
Svyatoslav Kuzmich 15acc412ba [Wasm] Update testdata after coroutines support 2021-10-12 08:42:00 +03:00
Ilmir Usmanov 5a47eaf215 Fix @JvmInline value class tests for JS BE 2021-10-11 12:09:52 +03:00
zhelenskiy 1da46586bd Replaced deprecated inline classes with JvmInline value classes in tests 2021-10-11 12:09:51 +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 e18980b7ad [Wasm] Clean wasm testdata annotations 2021-10-07 22:36:17 +03:00
Ilmir Usmanov 27081231d9 Use original instead of lowered function to retrieve toString-impl
in string concatenation lowering. Otherwise, inliner tries to get
body of already lowered function, failing.
 #KT-48284 Fixed
2021-10-06 11:12:26 +00:00
pyos 337cbeded1 JVM_IR: do not move receivers on functions with inline class parameters
^KT-48993 Fixed
2021-10-05 13:34:32 +02: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
Alexander Udalov b821b26cfe JVM IR: do not try to optimize casts in TypeOperatorLowering
In case the cast value is used as a receiver to a private method call,
the cast is actually necessary, see KT-48927. Also, this optimization
has backfired once already (see kt48659_identityEqualsWithCastToAny.kt).
It seems that the best way to optimize these casts is not to generate
them in the first place, and/or use bytecode postprocessing.

Apparently the only kind of casts which need to be eliminated are those
which occur on an inline class to its supertype. Otherwise the
unsafe-coerce intrinsic is inserted at the incorrect place, and several
tests fail (uncastInlineClassToAnyAndBack.kt, genericOverride.kt,
classGenericOverride.kt).

 #KT-48927 Fixed
2021-09-30 13:32:36 +02:00
Svyatoslav Kuzmich 5c05ff48ff [Wasm] Copy property reference lowering from K/N 2021-09-27 17:07:39 +03:00