Commit Graph

474 Commits

Author SHA1 Message Date
Nikolay Lunyak 3b5fff5473 [FIR] Don't copy VP default values for fake overrides
In general, overrides should not
contain default values, and it's
better to make fake overrides be close
to proper overrides as much as
possible. It will be important when
we begin running `FirOverrideChecker`
for fake overrides.

^KT-63879 Fixed
^KT-65534
2024-02-15 16:10:13 +00:00
Mikhail Glukhikh 672b5ba0d7 K2/Java: implement platform-dependent function filtering in JvmMappedScope
We drop Kotlin function 'remove' or 'getOrDefault' from JvmMappedScope,
if it has platform-dependent annotation, and the bound Java class scope
does not contain a function with the same signature.

#KT-57268 Fixed
2024-01-30 19:44:00 +00:00
vladislav.grechko 34bac48541 Add JVM ABI K1/K2 consistency tests 2023-12-26 10:18:19 +00:00
Ilmir Usmanov 197f0112b4 Minor. Add regression test for KT-62127
#KT-62127 Fixed
2023-10-09 12:43:27 +00:00
vladislav.grechko 8f2825506a Don't do full type parameters erasure in PromisedValue::materializeAt
The only case when erasure matters in a context of materialization of
`PromisedValue` is when the type is a type parameter which upper bound
is an inline class. Since `PromisedValue::materializeAt` is a hot spot
and `eraseTypeParameters` is an expensive operation, we should not do
type erasure in other cases.
2023-08-29 18:46:53 +00:00
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00
Vladimir Sukharev a036e41809 [Test] Convert IGNORE: NATIVE directives in box tests from D to I
^KT-59057

Merge-request: KT-MR-10748
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 09:11:17 +00:00
Alexander Udalov 1588b07472 Tests: unmute light analysis tests passing with JVM_IR 2023-06-22 17:10:51 +02:00
Artem Kobzar 039b5fca7a [K/JS] Use declared upper-bound types for parameters inside inlined functions body, instead of the provided types 2023-06-20 12:01:28 +00:00
vladislav.grechko 457837a255 Fix function invocation mangling rule
Mangle invocations of functions with value classes in signature which
override (directly or indirectly) a method declared in Kotlin code.
Otherwise, NoSuchMethodError is being thrown.

^KT-55945: Fixed
2023-06-15 09:34:21 +00:00
Mikhail Glukhikh f48142a6e6 FIR2IR: fix binding of data class generated members
Related to KT-54844
#KT-54952 Fixed
#KT-54887 Fixed
2023-06-14 07:09:15 +00:00
Mikhail Glukhikh c898b264ba FIR2IR: fix receiver of value classes method references
This commit fixes the receiver of these method in FIR2IR code
by removing a particular hack.
However, as the consequence of it 2 black box tests become broken in K2.
The reason is KT-54952 which is not yet fixed

Related to KT-54887
2023-06-14 07:09:15 +00:00
Ilmir Usmanov a0484de1a6 JVM_IR: Do not copy static init blocks to inline class's constructor
#KT-58593 Fixed
2023-05-24 13:24:47 +00:00
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
Evgeniy.Zhelenskiy aceab2ac1f [IR] Fix KT-57973
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-57973
2023-04-17 12:33:10 +00:00
Evgeniy.Zhelenskiy 8c748bfea4 [IR] Add more tests for inline/value classes secondary constructors
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-55333
2023-04-17 12:10:14 +00:00
Abduqodiri Qurbonzoda b65a68ca0d [K/N and WASM] Internalize NoWhenBranchMatchedException and UninitializedPropertyAccessException
As a part of efforts to stabilize Native stdlib.

Merge-request: KT-MR-9531
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-04-10 21:10:51 +00:00
vladislav.grechko 35dfcb61bb Fix specialization of equality comparison calls for inline classes
Receiver of equals() call should be checked instead of argument

^KT-57261: Fixed
2023-03-13 23:39:35 +00:00
vladislav.grechko 8039e30bbd Fix condition of generating equals-impl0 call
This methods should not be called when instances of different inline
classes are being compared

^KT-57242: Fixed
2023-03-13 23:39:34 +00:00
Mikhail Glukhikh f7036aa79c FIR2IR: don't generate default parameters for delegated members
#KT-55465 Fixed
2023-02-27 12:58:27 +00:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Igor Yakovlev f7940a2d46 [Wasm] Fix invalid cast generation for inline classes 2023-01-04 17:16:04 +00:00
Vladimir Sukharev 924898afb7 [K/N] KFC-446: K2 platform: Native alpha
Merge-request: KT-MR-7905
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-04 16:10:40 +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
Evgeniy.Zhelenskiy f09fb5ed09 [IR] Enable tests for inline classes secondary constructors with body for not JVM
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-55333
2022-12-11 22:06:47 +01:00
Evgeniy.Zhelenskiy abc1d942d1 [IR] Add tests for value classes secondary constructors with body and set language feature version for the feature
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-55333
2022-12-11 22:06:47 +01:00
Vladislav Grechko cb93e9d408 Get rid of redundant boxing of unsigned operands of infix 'compareTo'
^KT-48759: Fixed
2022-12-02 18:25:52 +00:00
Dmitriy Novozhilov 1281b778fb [Test] Fix broken testdata 2022-12-01 14:47:24 +02:00
Evgeniy.Zhelenskiy fa4a4e56f3 [Tests] Remove unnecessary usages of OPTIONAL_JVM_INLINE_ANNOTATION
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:42 +00:00
Evgeniy.Zhelenskiy 4d426fc4cd [IR] Generate not FIR_IDENTICAL box fir value classes tests
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:39 +00:00
Evgeniy.Zhelenskiy 9f01ccc304 [IR] Support user-defined equals for MFVC
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:36 +00:00
Evgeniy.Zhelenskiy 6107caa8e2 [FE1.0, FIR] Support secondary constructors for Value Classes
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:35 +00:00
Vladislav Grechko cd6e865fb3 Improve support of 'lateinit' modifier
- Allow 'lateinit' for inline classes which underlying type
is suitable for 'lateinit'

- K2: report all problems related to 'lateinit' modifier

^KT-55052: Fixed
2022-11-24 19:47:21 +00:00
vladislav.grechko e0c13e5276 Fix addAll & putAll invocations on inline mutable collections
^KT-54950: Fixed
2022-11-24 19:27:42 +00:00
vladislav.grechko 36b8ba8df3 Improve support of custom equals in inline classes
- Ensure that typed equals parameter's type is a star projection of
  corresponding inline class

- Make possible to declare typed equals that returns 'Nothing'

- Forbid type parameters in typed equals operator declaration

^KT-54909 fixed
^KT-54910 fixed
2022-11-17 15:35:14 +01:00
Ilya Chernikov 7e4ee399c8 FIR JS: temporarily mute remaining codegen tests 2022-11-12 16:28:25 +01:00
pyos fbb54f0300 FIR: fix Clonable detection condition in inline checker 2022-11-10 11:34:53 +01:00
Xin Wang 4d9c2d3d14 Don't treat java constructor as 'hidden' one
Fix KT-54656
2022-11-02 12:56:38 +01:00
vladislav.grechko 6f4a60ac91 Fix equality comparison for inline class over inline class
^KT-54536: Fixed
2022-10-21 21:17:40 +00:00
vladislav.grechko db133bedf9 Fix ClassCastException on equality comparison on inline class objects
^KT-54603: Fixed
2022-10-21 21:17:40 +00:00
vladislav.grechko c990bbb26c Get rid of excess method in compiled inline class with custom equals
^KT-54501: Fixed
2022-10-21 12:57:11 +00:00
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