Commit Graph

7531 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
Alexander Udalov 14c2030595 Merge K2 bytecodeListing tests to main bytecodeListing tests 2023-03-27 10:32:17 +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
Nikolay Lunyak 505edb9746 [FIR2IR] KT-57211: Support unsigned arrayOf-s in fir2ir
^KT-57211 Fixed

Merge-request: KT-MR-9294
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-03-22 13:10:17 +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
Mads Ager a525983e38 [JVM IR] Use error types in KAPT mode for unresolved delegate types.
^KT-57388 Fixed
2023-03-21 22:09:14 +01: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
Svyatoslav Kuzmich 1b7c63bd49 [Wasm] Fix js interop closure signature
Before we used IrType.render() which is not unique.
This changes adds a proper serialization of adapter signature to string.
2023-03-20 15:16:00 +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
Svyatoslav Kuzmich 1208a26fc4 [Wasm] Use JsAny, JsHandle and other Js* types in stdlib and kotlin-test 2023-03-16 09:12:07 +00:00
Svyatoslav Kuzmich 1e91fe155b [Wasm] Restrict types allowed in JS interop
- Prohibit Any, Array and other unsupported non-external types in JS
  interop context
- Add K1 diagnostic
- Update BE testdata

^KT-57136 Fixed
2023-03-16 09:12:07 +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
Alexander Udalov f0fba7be64 K2: add bytecode listing tests
#KT-57171 Fixed
2023-03-14 21:57:26 +01:00
Ivan Kylchik 49fdfc2992 Suppress some JMV IR inliner delegation tests for K2 2023-03-14 20:47:46 +00:00
Ivan Kylchik d2e92fd70d Add additional test cases and notes for KT44429 2023-03-14 20:47:45 +00:00
Ivan Kylchik 0af4ef8ee9 Fix typo in test name: inlinInDefault -> inlineInDefault 2023-03-14 20:47:43 +00:00
Ivan Kylchik b812a6c6f5 Ignore tests that are currently not working with IR inliner 2023-03-14 20:47:42 +00:00
Ivan Kylchik bb401c39d9 Add several new SMAP tests
Some of them are still failing and suppose to be
fixed later
2023-03-14 20:47:39 +00:00