Commit Graph

124 Commits

Author SHA1 Message Date
Alexander Udalov 3120a35a88 JvmDefault: remove most tests on @JvmDefault
The tests are removed because JvmDefault is going to be deprecated with
error in KT-54746 and removed later in KT-57696.

Many of the removed tests already had existing counterparts with the new
modes `all` and `all-compatibility`. In this change, I've added such
tests where they were missing, and removed tests which were testing
behavior specific to the JvmDefault annotation, such as some
diagnostics.

 #KT-54746
2023-04-25 14:33:00 +00:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
pyos 67a6785f63 FIR DFA: move eq/notEq null-to-type translation to LogicSystem
This makes the `returns() implies` checker slightly cleaner, and also
fixes the case that I've missed where in RHS of `x ?:` type of `x` was
not set to `Nothing?`.
2022-11-22 15:44:37 +00:00
vladislav.grechko 5ec2f1ad92 Get rid of redundant boxing when comparing inline class instances
^KT-33722: Fixed
2022-11-18 23:14:03 +00:00
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00
Pavel Mikhailovskii ecb3cc193c KT-51883 Don't use "-" in generated unique lifted declaration names 2022-06-10 18:36:04 +00: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
Mikhail Glukhikh 5a44fda42c FIR2IR: bind fake override calls via symbol table 2021-11-09 21:04:37 +03:00
Mikhail Glukhikh 0622a47493 FIR2IR: implement early f/o overridden symbols binding #KT-42784 Fixed
Related to KT-49288
2021-11-09 21:04:36 +03:00
Mikhail Glukhikh 5b6e21690b FIR2IR: call fake overrides properly #KT-49288 Fixed 2021-11-09 21:04:35 +03:00
Dmitriy Novozhilov 85c7f386eb Add Kotlin 1.7 language version 2021-07-20 13:33:41 +03:00
Ilmir Usmanov c4ddf3530d Use GETFIELD instead of unbox-impl inside inline classes
#KT-36783 Fixed
2021-05-12 06:50:06 +00:00
Steven Schäfer 84d78035e4 JVM IR: Avoid double mangling of function reference invoke methods 2021-04-29 13:10:43 +02:00
Mikhael Bogdanov 3d8e8dd3ba Fail on compilation errors in AbstractBytecodeTextTest 2021-02-17 18:43:23 +01:00
Mikhail Glukhikh 465261e611 FIR: don't create intersection override for duplicating symbols 2021-02-02 16:25:08 +03:00
Alexander Udalov d022bb0248 Switch default JVM target to 1.8
#KT-29405 Fixed
2021-02-01 11:54:04 +01:00
Georgy Bronnikov 076272f7ca FIR2IR: avoid descriptors computing hashCode
When synthesizing the hashCode function for data classes, descriptors
were used, in partcular, memberScope for primitive classes.
IrBasedDescriptors have no member scope, so we compute the hashCode
function based on IR structures.
2020-12-23 18:50:52 +03:00
Ilmir Usmanov 0dc5f3ac00 IC: call JvmDefault method of inline class using boxed receiver
#KT-43698 Fixed
2020-12-08 04:33:36 +01:00
Dmitry Petrov e6a3e38c4d JVM_IR no static inline class members for Kotlin JvmDefault methods
KT-43698 KT-43051
2020-12-02 20:04:13 +03:00
Mikhail Glukhikh 1c71e64f58 [FIR] Create string interpolating call even for single argument
Before this commit, questionable optimization existed which
unwrapped string interpolating call with single argument to this argument.
However, this led to source element loss and the necessity of sub-hacks.
In this commit we dropped this optimization (anyway user can remove
this single-expression string template in code if needed) to keep
source elements intact.
2020-11-26 08:37:50 +03:00
Ilmir Usmanov b33774e5f2 IC mangling: Use empty list as a separator in the new mangling scheme 2020-11-19 17:39:28 +01:00
Ilmir Usmanov 488d4ab018 IC mangling: Use '_' instead of 'x' as a placeholder before hashing 2020-11-19 17:39:27 +01:00
Ilmir Usmanov c62093f54c IC mangling: Change mangling rules
1. Use 'x' for each parameter, which is not an inline class, every
possible clash is handled by signature rather than name. This change
makes more API changes binary-compatible. So, the changes are in line
with the vision of inline classes are value classes, like primitives.

2. Take return type into account when mangling a function if the return
type is inline class. Otherwise, boxing bridge will not be generated,
which leads to CCE at runtime.
2020-11-19 17:39:24 +01:00
Ilmir Usmanov 7b315a8b52 JVM_IR: Do not box inline class in methods 2020-11-02 10:50:00 +01:00
Ilmir Usmanov 28e148d35a Old JVM: support init blocks in inline classes
#KT-28055 Fixed
2020-10-29 20:38:03 +01:00
Mark Punzalan 238cc7c257 [FIR] Enable BytecodeText tests for FIR.
143 out of 767 tests (18.6%) are currently failing.
2020-09-29 10:21:21 +03:00
pyos bd6ead0467 JVM_IR: check for null when converting unboxed inline classes to strings
`C?` can be unboxed into `T?` if if wraps a reference type `T!!`, but in
this case `null` is not a valid value to pass to `toString-impl`.

 #KT-42005 Fixed
2020-09-25 16:50:34 +02:00
Steven Schäfer 78ab957bfe JVM IR: Fix mangling for suspend functions with inline class params (KT-41374) 2020-08-31 18:43:29 +02:00
Steven Schäfer 097e0fb46c JVM IR: Mangle delegated properties with inline class type (KT-40125) 2020-07-10 17:06:44 +02:00
Dmitry Petrov 202bbdf8dd Forward compatibility hacks for Result.{success, failure}
Don't mangled functions annotated with @JvmName.
Annotate 'Result.success' and 'Result.failure' with @JvmName and
@Suppress("INAPPLICABLE_JVM_NAME").
NB this would require bootstrap.
2020-06-04 12:16:27 +03:00
Steven Schäfer 7ea71a17f0 JVM IR: Use language feature for inline class mangling rules 2020-05-29 19:54:09 +03:00
Dmitry Petrov a270ee094c Language feature for new inline class mangling rules (since 1.4) 2020-05-29 00:53:01 +03:00
Steven Schäfer dc0ef996b7 JVM IR: Implement the new inline class ABI 2020-05-28 18:00:35 +03:00
Dmitry Petrov c165b8d55c JVM: Update IR bytecode text and signature tests 2020-05-20 07:19:30 +03:00
Dmitry Petrov cf70c83ab7 JVM: Update tests 2020-05-20 07:19:29 +03:00
Dmitry Petrov 9615b20e5d Box inline class return value in lambdas (including suspend lambdas) 2020-04-08 19:56:26 +03:00
Steven Schäfer 6a1e35389c JVM IR: Mangle interface implementation methods in inline classes 2020-03-16 18:48:16 +01:00
Steven Schäfer 465e9f2d68 JVM IR: Always produce stubs for interface methods in inline classes
This matches the behavior of the JVM backend, with the exception of
@JvmDefault methods, which are currently broken on the JVM backend.
2020-02-28 14:48:17 +01:00
Dmitry Petrov 94d20d9176 Update bytecode text tests in JVM_IR 2020-02-17 23:52:48 +03:00
Steven Schäfer 5760c0be9c JVM IR: Avoid redundant coercions in ExpressionCodegen 2020-02-15 22:32:23 +03:00
Alexander Udalov 6a90dc2efe Fix bytecode text tests for language version 1.4
New null check assertions are generated a bit more efficiently, with a
call to `checkNotNull` instead of IFNONNULL+jump.
2020-01-20 19:12:59 +01:00
Mikhail Zarechenskiy 5c5635ce20 Fix codegen & bytecode tests after unifying exceptions in JVM backend
See KT-22275 for details
2020-01-20 16:36:03 +03:00
Alexander Udalov e9946b21b5 JVM IR: do not hide constructor with inline class types and defaults
This corresponds to the ABI generated by the old backend. Moreover, when
compiling the module 'ir.tree' with JVM IR (could not reproduce on a
small sample), this led to a codegen crash when trying to reassign
parameter value to the default stub, which is an error expression and
can't be generated by ExpressionCodegen.
2019-12-02 10:19:55 +01:00
Steven Schäfer c905209504 JVM IR: Lower IrStringConcatenation 2019-10-18 17:24:53 +02:00
Steven Schäfer 21af7dfbe1 Add tests for constructors taking inline class arguments 2019-10-18 17:20:22 +02:00
pyos 06c00f4d9e Unmute some JVM_IR inlining tests 2019-10-08 17:19:41 +02:00
Steven Schäfer ce3ef4e4d0 Add more tests for inline class equality with nullable arguments 2019-09-18 18:52:58 +02:00
Steven Schäfer 49efa5fbc4 Split up Result API boxing tests 2019-09-18 18:52:58 +02:00
Steven Schäfer b85b2d9af8 Add more tests for inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer cdc5e1347b JVM: Avoid boxing in inline class equality 2019-09-18 18:52:58 +02:00