Commit Graph

433 Commits

Author SHA1 Message Date
vladislav.grechko 70c2f2b86f Support specifying different bytecode listings for FIR and old frontend 2022-10-21 12:57:11 +00:00
vladislav.grechko b5a23e3ef7 Minor: improve usability of tests for custom equals in inline classes 2022-10-17 14:11:01 +00:00
vladislav.grechko cc1b4243dd Fix exception on 'equals()' returning 'Nothing' in inline class
^KT-54401: Fixed
2022-10-17 14:11:00 +00:00
vladislav.grechko aeccc2e787 Fix equality comparison of inline classes with primitive underlying type
^KT-54455 Fixed
2022-10-14 23:25:48 +00:00
vladislav.grechko 817afcd4af KT-MR-7307 review fixes 2022-10-13 15:19:10 +00:00
vladislav.grechko e0c8142106 Support of custom 'equals' and 'hashCode' in inline classes
'equals' from any made available for overriding in inline classes
'typed' equals made available for definition in inline classes
'typed' equals definition made compulsory if 'untyped' is overridden
'operator' keyword is allowed in 'typed' equals definition

^KT-24874: Fixed
2022-10-10 16:52:34 +00:00
Alexander Udalov 4baa74f396 Add regression tests for obsolete issues
#KT-50909
 #KT-50974
 #KT-51888
2022-09-28 23:18:59 +02:00
Ilmir Usmanov 569e72c34e Minor. Do not check for specific bytecode in test 2022-09-21 16:42:15 +00:00
Xin Wang 0eadf35132 Inline: Fix operand stack type verify error
This is a proposal to fix KT-49364.
Operand stack type verification happens before `checkcast`
is executed. When we implicitly cast an inline class
to a non-inline type, if type of stack value is not subtype
of the target, then coercing is necessary.
2022-09-21 16:42:14 +00:00
Igor Yakovlev 61d6f69bca [WASM] Native support of returnable blocks 2022-09-15 16:27:41 +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
Ilmir Usmanov a5084c2f69 JVM IR: Make receiver type of IrGetField not null
otherwise, it will be mapped to inline class type if underlying type
is primitive of nullable.

 #KT-52913 Fixed
2022-06-30 01:28:09 +00:00
Pavel Mikhailovskii bcd8a28d4c KT-47823 IR.JVM Fix handling of for loop ranges with inline types and break/continue/return 2022-06-10 18:42:28 +00:00
Steven Schäfer dbb6144ab0 JVM IR: Avoid boxing in generic floating point equality (KT-48635) 2022-06-08 15:38:06 +02:00
Steven Schäfer 90d09dce2c JVM IR: Mangle overridden symbols in non-inline functions (KT-52394) 2022-05-17 12:13:29 +00:00
Steven Schäfer 1134dc3858 JVM IR: Resolve fake overrides during inline class mangling
This is necessary to determine which mangling scheme to use (KT-51672).
2022-03-24 00:38:34 +00:00
Ilmir Usmanov 254ada88d1 Minor. Add test with inline class inside inline class's init block 2022-03-04 05:23:23 +03:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Ilmir Usmanov 8811f62300 Fix mapping of nullable generic underlying types of inline classes
#KT-32162 Fixed
2022-02-23 01:23:07 +03:00
Ilmir Usmanov c072448d22 Lower fun interface children's body during inline class lowering
#KT-51121 Fixed
2022-02-21 19:50:12 +03:00
Alexander Udalov e5e5970883 JVM IR: workaround indirect dependency between lowerings
#KT-51353 Fixed
2022-02-18 17:04:18 +01:00
Ilmir Usmanov 28b60d7e61 Add another flavor to android tests 2022-02-18 08:50:25 +00:00
Ilmir Usmanov 05457c291d Minor. Update test 2022-02-17 09:00:37 +03:00
Ilmir Usmanov f4407c213a Rename some tests with long names
Otherwise, their path on WIN will be longer than MAXPATH, leading to
V8 load error.
2022-02-16 23:46:30 +03:00
Ilmir Usmanov 290a06676d Minor. Ignore tests in JS_IR 2022-02-16 16:12:29 +03:00
Pavel Punegov 33931bf010 [K/N][test] Ignore test that uses JvmInline 2022-02-15 12:41:25 +03:00
Ilmir Usmanov 714c5091cc Add regression test for KT-51254
#KT-51254 Fixed
2022-02-15 08:11:21 +01:00
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