'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
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
[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>
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
At first, I tried to modify the logic in PromisedValue.materializeAt
to get rid of all casts from Nothing? to other types, but that broke
a number of tests containing casts of java.lang.Void to other types,
so I decided to fix only this particular case with try...catch
(for some reason, here we get a null of type java.lang.Object).
If the super class is in a file that has already been lowered, the base
method has an extra continuation parameter which breaks things.
Also, SAM wrappers around functional objects are tail-call and do not
need continuations ever, so don't even try.
^KT-50950 Fixed
Test data in `box/annotations/typeAnnotations` is changed because nested
classes in type annotations are rendered differently in JDK 19
(`Outer.Nested` instead of `Outer$Nested`).
#KT-54116 Fixed
We already check for {POP, Unit} sequence before ARETURN, but if the
there are multiple sequence before ARETURN, the compiler assumes, that
TCO misses.
The fix is to check, that the instruction after the sequence is either
ARETURN or another {POP, Unit} sequence.
#KT-50835
#KT-54152 Fixed