Commit Graph

7193 Commits

Author SHA1 Message Date
Igor Yakovlev 5218acd5c9 [WASM] Optimise interop adapters 2022-10-18 20:48:12 +02:00
pyos 1fcf099104 FIR: serialize both expanded and abbreviated type to metadata 2022-10-18 14:59:11 +00:00
Ivan Kylchik 1ce99db830 Change class loader in ir interpreter that is used to create proxy obj
#KT-54509 Fixed
2022-10-18 13:47:34 +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
Ivan Kochurkin 69ee40325b [FIR] Fix dependencyProviders generation in FirDependenciesSymbolProviderImpl
Get rid of unnecessary creating of FirCompositeSymbolProvider
2022-10-13 18:11:49 +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
Pavel Mikhailovskii 0947834f0d Add a test for KT-54318 2022-10-10 13:47:34 +02:00
Pavel Mikhailovskii 5fdfd4a421 Revert "KT-53146 Don't coerce Nothing? returned from "catch" clauses"
This reverts commit 903a5d69a4.
2022-10-10 13:36:44 +02:00
Evgeniy.Zhelenskiy 6117cdc0c3 [IR] Remove unused MFVC getters
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-10-07 12:43:46 +00:00
Evgeniy.Zhelenskiy 9dd308dc01 [IR] Add context receivers test, fix a flattening fields bug
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-10-07 12:43:46 +00:00
Evgeniy.Zhelenskiy e1f886936c [IR] Support try for MFVC
#KT-1179
2022-10-07 12:43:45 +00:00
Evgeniy.Zhelenskiy f8aa3612f8 [IR] Support if and when for MFVC, fix several bugs, refactor
#KT-1179
2022-10-07 12:43:44 +00:00
Evgeniy.Zhelenskiy 70293fab60 [IR] Rename MFVC tests + Add test for get-field optimization
#KT-1179
2022-10-07 12:43:43 +00:00
Evgeniy.Zhelenskiy ec3c0af09d [IR] Suppress temporary test failing on Android
Bug is fixed in https://jetbrains.team/p/kt/reviews/6452

#KT-1179
2022-10-07 12:43:42 +00:00
Evgeniy.Zhelenskiy 6f94af80ab [IR] Correct work of the new MFVC lowering classes
#KT-1179
2022-10-07 12:43:42 +00:00
Evgeniy.Zhelenskiy 8ba20bee5b [IR] Prepare MFVC-lowering for the new MFVC classes
#KT-1179
2022-10-07 12:43:41 +00:00
Evgeniy.Zhelenskiy eb0aa55571 [IR] Fix MFVC with type arguments/parameters
#KT-1179
2022-10-07 12:43:40 +00:00
Evgeniy.Zhelenskiy f9bed3d946 [IR] Support MFVC with type parameters
#KT-1179
2022-10-07 12:43:40 +00:00
Evgeniy.Zhelenskiy 14b8e41967 [IR] Integrate MFVC with Inline classes
#KT-1179
2022-10-07 12:43:39 +00:00
Evgeniy.Zhelenskiy 765c212327 [IR] Add MFVC generation tests
#KT-1179
2022-10-07 12:43:38 +00:00
Evgeniy.Zhelenskiy 894cdc2307 [IR] Implement equals call correct generation for MFVC
#KT-1179
2022-10-07 12:43:37 +00:00
Evgeniy.Zhelenskiy 0d350f94f2 [IR] Implement bridges generation for MFVC
#KT-1179
2022-10-07 12:43:37 +00:00
Evgeniy.Zhelenskiy 0c1c25e477 [IR] Implement MFVC basic flattening
#KT-1179
2022-10-07 12:43:36 +00:00
Evgeniy.Zhelenskiy d4969e9b97 Revert "rra/zhelenskiy/flattening_impl"
This reverts commit b7f5c039a6.
2022-10-07 12:43:36 +00:00
Evgeniy.Zhelenskiy dff949344d [IR] Remove unused MFVC getters
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-10-07 12:42:15 +00:00
Evgeniy.Zhelenskiy 5c0784fef5 [IR] Add context receivers test, fix a flattening fields bug
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-10-07 12:42:14 +00:00
Evgeniy.Zhelenskiy afe67f9bc1 [IR] Support try for MFVC
#KT-1179
2022-10-07 12:42:14 +00:00
Evgeniy.Zhelenskiy ca789607ba [IR] Support if and when for MFVC, fix several bugs, refactor
#KT-1179
2022-10-07 12:42:13 +00:00
Evgeniy.Zhelenskiy e76041bb3b [IR] Rename MFVC tests + Add test for get-field optimization
#KT-1179
2022-10-07 12:42:12 +00:00
Evgeniy.Zhelenskiy 2c50fef251 [IR] Suppress temporary test failing on Android
Bug is fixed in https://jetbrains.team/p/kt/reviews/6452

#KT-1179
2022-10-07 12:42:12 +00:00
Evgeniy.Zhelenskiy c2284d15a5 [IR] Correct work of the new MFVC lowering classes
#KT-1179
2022-10-07 12:42:11 +00:00
Evgeniy.Zhelenskiy 5ea1edf6d1 [IR] Prepare MFVC-lowering for the new MFVC classes
#KT-1179
2022-10-07 12:42:10 +00:00
Evgeniy.Zhelenskiy d0590e4e83 [IR] Fix MFVC with type arguments/parameters
#KT-1179
2022-10-07 12:42:10 +00:00
Evgeniy.Zhelenskiy cd432b1371 [IR] Support MFVC with type parameters
#KT-1179
2022-10-07 12:42:09 +00:00
Evgeniy.Zhelenskiy b1dced6cda [IR] Integrate MFVC with Inline classes
#KT-1179
2022-10-07 12:42:08 +00:00
Evgeniy.Zhelenskiy a788433aac [IR] Add MFVC generation tests
#KT-1179
2022-10-07 12:42:07 +00:00
Evgeniy.Zhelenskiy 73b0fac657 [IR] Implement equals call correct generation for MFVC
#KT-1179
2022-10-07 12:42:07 +00:00
Evgeniy.Zhelenskiy ee2d327243 [IR] Implement bridges generation for MFVC
#KT-1179
2022-10-07 12:42:06 +00:00
Evgeniy.Zhelenskiy 2896f5613d [IR] Implement MFVC basic flattening
#KT-1179
2022-10-07 12:42:06 +00:00
Evgeniy.Zhelenskiy 93ffd9f233 Revert "rra/zhelenskiy/flattening_impl"
This reverts commit b7f5c039a6.
2022-10-07 12:42:05 +00:00
Alexander Udalov 4dcf50d483 Fix reflection for repeated annotations with array arguments
This is related to 8308f5d7d3 (KT-44977).

It turns out that it's necessary to create `ArrayValue` with a
precomputed type not only in case of annotations stored directly in
Kotlin metadata (i.e. annotations on types and type parameters), but
also for arguments of repeated annotations. The reason is that repeated
annotations are stored in an array themselves, as an argument to another
(container) annotation. The annotation-reading code unwraps this array
to load repeated annotations as individual instances of
`AnnotationDescriptor`, but in contrast to loading normal annotations,
it doesn't set `source` to the reflection object, it uses `NO_SOURCE`
(see BinaryClassAnnotationAndConstantLoaderImpl.AbstractAnnotationArgumentVisitor.visitArray).

So when kotlin-reflect is later asked for the arguments of the
annotation, it needs to recreate the reflection object from
`AnnotationDescriptor` in `util.kt`. Doing so requires knowing the array
type, which is now present because we're creating a `TypedArrayValue`
(previously `DeserializedArrayValue`) in places where arrays are read as
annotation arguments.

Alternative solution would be to fix source passed to
`AnnotationDescriptorImpl` in the annotation-reading code, but that
seems a bit messy because the code is very abstract and is used in lots
of other places.

 #KT-53279 Fixed
2022-10-07 10:48:51 +00:00
Alexander Udalov 51ce829b96 Fix reflection class lookup in default package
Do not append "." to the name of the class in the default package.
2022-10-07 10:48:51 +00:00
Evgeniy.Zhelenskiy b7f5c039a6 rra/zhelenskiy/flattening_impl
[IR] Remove unused MFVC getters

Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179

[IR] Add context receivers test, fix a flattening fields bug

Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179

[IR] Support `try` for MFVC

#KT-1179

[IR] Support `if` and `when` for MFVC, fix several bugs, refactor

#KT-1179

[IR] Rename MFVC tests + Add test for get-field optimization

#KT-1179

[IR] Suppress temporary test failing on Android

Bug is fixed in https://jetbrains.team/p/kt/reviews/6452

#KT-1179

[IR] Document the new MFVC lowering classes when necessary

#KT-1179

[IR] Correct work of the new MFVC lowering classes

#KT-1179

[IR] Prepare MFVC-lowering for the new MFVC classes

#KT-1179

[IR] Fix MFVC with type arguments/parameters

#KT-1179

[IR] Support MFVC with type parameters

#KT-1179

[IR] Integrate MFVC with Inline classes

#KT-1179

[IR] Fix compilation of MFVC in different module

#KT-1179

[IR] Add MFVC generation tests

#KT-1179

[IR] Implement equals call correct generation for MFVC

#KT-1179

[IR] Implement bridges generation for MFVC

#KT-1179

[IR] Implement MFVC basic flattening

#KT-1179

Merge-request: KT-MR-6213
Merged-by: Evgeniy Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>
2022-10-06 20:45:45 +00:00
pyos 8d33de4297 JVM: partially reify typeOf and signatures as soon as possible
E.g. when substituting T -> Array<T>, write the bytecode for the
Array<...> part for typeOf.

This fixes various issues where either Array nesting levels, nullability
information (for typeOf), or entire reification markers were missing,
causing incorrect outputs ranging from missing `?`s to missing `[]`s to
just reified types not really being reified.

^KT-53761 Fixed
2022-10-06 00:58:25 +02:00
Leonid Startsev ccdb6fc599 Fix .equals for instantiated annotations with unsigned array types.
#KT-53876 Fixed
2022-10-03 13:54:06 +00:00
Dmitriy Novozhilov 6623456d2a [FIR] Properly support @JvmRecord
^KT-53867 Fixed
2022-10-03 15:48:17 +03:00
Dmitriy Novozhilov c0ad67c4f9 [FIR] Generate java declarations for record components of java records
^KT-53964 Fixed
2022-10-03 15:48:17 +03:00