Commit Graph

5045 Commits

Author SHA1 Message Date
Igor Yakovlev 44190937b0 [Wasm] Fix generic call return type for functions with default parameters 2023-04-04 18:39:18 +00:00
Igor Yakovlev 993334e5e4 [Wasm] Support feature InstantiationOfAnnotationClasses 2023-04-04 18:39:17 +00:00
Ivan Kylchik 32297c0f21 Serialize and deserialize const val's properly for K2 klib
#KT-57312 Fixed
2023-04-04 12:35:54 +00:00
Pavel Kunyavskiy 09474758ab [K/N] Fix typo in language feature name 2023-04-04 09:13:36 +00:00
Dmitriy Novozhilov d7d7620db2 [FIR2IR] Correctly calculate signature for non-dynamic calls on dynamic receiver
If dispatch receiver is dynamic and call on it is not dynamic that means
  that this call was resolved to some specific declaration because of
  smartcast. So we should use original type of this declaration as
  dispatch receiver during calculation of IdSignature instead of Any
  (which came from dynamic type). Otherwise we will have two different
  signatures for the same member declaration

^KT-57682 Fixed
2023-04-03 12:20:01 +00:00
Nikolay Lunyak f0720c1d12 [FIR] Fix K2 behavior according to RULES1
The compiler should only report diagnostics for
comparisons over builtins and identity-less types,
other incompatibilities should be reported
via inspections.

It's ok that in `equalityChecksOnIntegerTypes`
instead of `EQUALITY_NOT_APPLICABLE_WARNING` we get
`EQUALITY_NOT_APPLICABLE`, because
`ProperEqualityChecksInBuilderInferenceCalls`
is already active by default.

This change also replaces the notion of a representative superclass
with the least upper bound.
This makes complex types like
intersection/flexible transparent to
RULES1-based compatibility checks.
One way to look at it is to think
that this is an automatic way of handling
type parameters: automatic picking of
"interesting" bounds, and checking them against one another.

Note that `TypeIntersector.intersectTypes`
for `Int` and `T` where `T` is a type parameter
may return both `{Int & T}` or `null`
depending on `T`-s bounds. At the same time,
for type parameters `T` and `K` it will
always return `{T & K}`.

`ConeTypeIntersector.intersectTypes`, on the
other hand, will always return `{Int & T}`
irrespectively of the bounds. Meaning, the two
intersectors differ in corner cases.

`lowerBoundIfFlexible` call in `isLiterallyTypeParameter` is backed by
the `equalityOfFlexibleTypeParameters` test.

^KT-35134 #fixed-in-k2
^KT-22499 #fixed-in-k2
^KT-46383 #fixed-in-k2
2023-03-31 15:01:50 +00:00
Alexander Udalov 37c776b233 Add JVM target bytecode version 20
#KT-57495 Fixed
2023-03-30 19:05:41 +00:00
Vladimir Sukharev 351588f0a7 [K2/N] Enable some fixed MPP tests
Merge-request: KT-MR-9364
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-28 16:49:57 +00:00
Kirill Rakhman 32cc28c6cf [FIR] Skip expect-actual rules check when overriding non-expect member
Overriding equals, hashCode, toString and any other member that is not
expect does not require satisfying the rules of expect-actual matching.

#KT-57381 Fixed
2023-03-28 16:21:33 +00:00
Kirill Rakhman ee78c31174 [FIR2IR] Fix generation of Any method call on expect receiver
#KT-57583 Fixed
2023-03-28 12:47:42 +00:00
Mikhail Glukhikh 563781a246 K2: serialize data class equals / hashCode / toString functions
#KT-57510 Fixed
2023-03-28 09:30:02 +00:00
Vladimir Sukharev 9df5c54db3 [K2/N] KT-55828: Enable fixed tests
Merge-request: KT-MR-9246
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-27 17:25:54 +00:00
Vladimir Sukharev b375307aa6 KT-57349: Disable target-wide tests for K1/Native
Merge-request: KT-MR-9353
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-27 13:32:18 +00:00
Alexander Udalov e56e058b7b JVM IR: replace unoverridden Number.toChar with toInt().toChar()
This fixes failing tests for JVM_IR in
`box/primitiveTypes/numberToChar`.

 #KT-23447 Fixed
 #KT-46465
2023-03-27 10:46:15 +00:00
Alexander Udalov a962ec4553 Rework tests on Number.toChar with custom Number subclass
Simplify them, move to a subfolder, add a couple of new tests.
2023-03-27 10:46:15 +00:00
Dmitriy Novozhilov a64d8e8a31 [Stdlib] Deprecate and make open Number.toChar()
^KT-46465 Fixed
2023-03-27 10:46:13 +00:00
Alexander Udalov d3be38476a Merge K2 box tests to main box tests 2023-03-27 10:32:19 +00:00
Ivan Kylchik 63b340651d Add possibility to interpret and fold IrStringConcatenation expression 2023-03-24 15:55:06 +00:00
Ivan Kylchik 7cf9dda8dc [JS] Support evaluation of const intrinsics for K2
#KT-56023 Fixed
#KT-51582 Fixed
2023-03-24 15:55:04 +00:00
Ivan Kylchik e981b1f958 [Native] Support evaluation of const intrinsics for K2
#KT-56023
#KT-55469 Fixed
2023-03-24 15:55:03 +00:00
Ivan Kochurkin c14dcfce4f [K2, MPP, JS] Fix a compiler crash on transitive common dependencies
^KT-57431 Fixed
2023-03-24 14:48:28 +00:00
Ivan Kochurkin 4e67d82cd3 [K2, MPP] Make MPP tests from k2/basic target-wide
^KT-57349
2023-03-24 14:48:27 +00:00
Ivan Kochurkin ee73e4774b [K2, MPP] Remove redundant expect declarations from klib metadata
^KT-57250 Fixed

Introduce flat Fir2IrActualizedResult

It contains output from Fir2Ir and IrActualizer
2023-03-24 14:48:26 +00:00
Alexander Udalov 562b27db4e JVM IR: initialize enum entries without invokedynamic
#KT-57316 Fixed
2023-03-24 13:38:32 +00:00
Vladimir Sukharev 9407ec35e3 KT-57487: Add codegen test
Merge-request: KT-MR-9300
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-23 10:03:00 +00:00
Alexander Udalov 1bc299508a Fir2Ir: do not skip building static fake overrides for enums
Fake overrides are needed at least for static fields inherited from Java
interfaces. Not static methods though, because they are not inherited.

 #KT-57302 Fixed
2023-03-22 12:34:05 +00:00
Ivan Kochurkin ce7af9ff2b [K2, MPP] Support arguments with expect types in actual functions 2023-03-22 01:28:18 +00:00
Ivan Kylchik 8eeb7e2631 Modify test data to reflect changes with IntrinsicConstEvaluation 2023-03-21 20:02:44 +00:00
Mikhail Glukhikh 45e78455b2 K2: repeat K1 behavior around multiple inheritance by delegation
#KT-56720 Fixed
2023-03-21 16:16:20 +00:00
Kirill Rakhman 45d2424ad8 [FIR] Let prefix inc/dec call getter twice for compatibility with K1
#KT-57179 Fixed
2023-03-21 08:48:38 +00:00
Pavel Kunyavskiy 3afdce3168 [K/N] Fix volatile intrinsics tests on K2
^KT-55904
2023-03-21 06:28:51 +00:00
Kirill Rakhman 7a6a3a0b1d [FIR2IR] Fix generation of val initialization after smart-cast, again
#KT-57284
2023-03-17 13:29:48 +00:00
Dmitriy Novozhilov ca2492e1f8 [FIR2IR] Unwrap substitution overrides during generation of delegated members
^KT-55828 Fixed
2023-03-17 12:37:33 +00:00
Ilya Chernikov 0387ce0365 tmp: implement a hack to fix LA test
due to a missing mechanism to handle a case when LA succeeds while
codegen fails. See detailed comment in the source.
Fixes implicit conversion test introduced in the previous commit.
2023-03-17 08:57:52 +00:00
Ilya Chernikov be2a85be71 K2: support implicit integer to unsigned conversions...
with dedicated opt-in language feature and special
annotation or module capability.
Not intended for a general use, solves specific K/N
scenario with interop libs.
#KT-55902 fixed
2023-03-17 08:57:51 +00:00
Pavel Kunyavskiy e655e0a809 [K/N] Fix default argument lambda in suspend function code generation 2023-03-16 21:14:41 +00:00
Pavel Kunyavskiy 62fb3df7f0 [K/N] Disable scope initialization on constant access
^KT-57098
2023-03-15 09:03:19 +00:00
Vladimir Sukharev 5bd0a1a0ba Disable some tests due to open issues and incompatibility with K1/MPP
Merge-request: KT-MR-9206
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-15 06:55:27 +00:00
Ivan Kylchik b812a6c6f5 Ignore tests that are currently not working with IR inliner 2023-03-14 20:47:42 +00:00
Pavel Kunyavskiy dc2e072af2 [K/N] Make exception handling in initializers more consistent with jvm
^KT-57091
2023-03-14 12:59:14 +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
Evgeniy.Zhelenskiy 948714e7e5 [IR] Fix delegating MFVC constructors
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-13 19:49:10 +01:00
Svyatoslav Kuzmich a99ea1d3ce [Wasm] Support enumValues and enumValueOf functions
^KT-57276 Fixed

Merge-request: KT-MR-9169
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-03-13 14:13:31 +00:00
Evgeniy.Zhelenskiy 3b5ad0681f [IR] Fix compiler bugs with MFVC to let KorGE run
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-13 13:09:56 +00:00
Evgeniy.Zhelenskiy 9b3fc34f78 [IR] Add for statement to tests for MFVC returning from inline functions
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-13 13:09:56 +00:00
Evgeniy.Zhelenskiy 19424702e0 [IR] Fix mutable shared reference of MFVC type
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-13 13:09:55 +00:00
Kirill Rakhman b476eee6e3 [FIR2IR] Simplify generation of bound callable reference receivers
Remove a bunch of custom logic to determine when a callable reference is
bound or not (and hence mustn't have a receiver). Instead, a helper
extension is introduced to determine when a callable reference is bound
by checking if dispatch/extensionReceiver is not FirNoReceiver and the
referenced member is not static.

#KT-57253 Fixed
2023-03-13 08:48:39 +00:00
Mikhail Glukhikh a3f0e429e3 K2: report empty intersection warnings from completion properly 2023-03-11 10:15:25 +00:00
Nikolay Krasko 57934a6870 Revert "Revert "[K2/N] KT-57026, KT-57208: Adjust Native & JS test infrastructures for MPP testing""
This reverts commit c0c692844e.
2023-03-10 14:24:49 +01:00