Commit Graph

85 Commits

Author SHA1 Message Date
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
Evgeniy.Zhelenskiy 88f293d4a9 [IR] Support reflection for MFVC
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-07 21:44:43 +00:00
Alexander Udalov c58314fddf Reflection: improve and optimize kotlinFunction/kotlinProperty
- Make the implementations very similar, to fix KT-54833 where the
  companion object case was forgotten for kotlinProperty.
- Optimize both functions to look up the function/property by name
  first, to cover the most probable case when the JVM name of a
  declaration is equal to its Kotlin name. This fixes KT-55937.

 #KT-54833 Fixed
 #KT-55937 Fixed
2023-01-23 20:43:00 +01:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Dmitriy Novozhilov 7b7b8fbea7 [Test] Filter dependent modules by source kind in creating FirModuleInfo 2021-02-18 14:44:44 +03:00
Alexander Udalov 401f0ac583 Use TARGET_BACKEND instead of DONT_TARGET_EXACT_BACKEND in box against Java tests
"// TARGET_BACKEND: JVM" more clearly says that the test is
JVM-specific, rather than DONT_TARGET_EXACT_BACKEND which excludes all
other backends.
2021-02-11 13:50:08 +01:00
Dmitriy Novozhilov 29b96aa15d [Test] Properly merge box against java testdata into codegen/box
Previous commit about it was 3199ce03 and it was completely wrong
2021-02-04 10:53:50 +03:00
Ilmir Usmanov 89d45bf909 IC mangling: Use old mangling scheme in FIR tests
instead of ignoring them.
This affects all unsigned tests.
2020-11-19 17:39:31 +01:00
Ilmir Usmanov f7164404c9 IC mangling: Ignore FIR tests 2020-11-19 17:39:26 +01:00
Alexander Udalov dd33ed9297 Fix suspend function with inline class types in reflection
#KT-34024 Fixed
2020-11-02 19:33:23 +01:00
Jinseong Jeon 13ef97e51e FIR2IR: set proper visibility of backing fields with @JvmField 2020-07-17 12:42:11 +03:00
Mikhail Glukhikh 6b964cb61d [FIR2IR] Drop explicit receiver double-conversion for objects 2020-07-10 08:56:58 +03:00
Dmitry Petrov 761e47264a JVM_IR: fix property reference generation for inline class primary val 2020-07-03 17:51:30 +03:00
Dmitry Petrov 8da988b18e JVM_IR: Mangle primary val getter of inline class if required
TODO fix reflection
2020-07-02 22:39:06 +03:00
Dmitriy Novozhilov 624b9306f0 [FIR] Resolve LHS of type operator call in independent context
#KT-39046 Fixed
2020-07-02 15:10:51 +03:00
Jinseong Jeon 34174d6e7d FIR deserializer: load annotations for property and fields, along with use-site targets 2020-06-30 17:28:22 +03:00
Jinseong Jeon 856ac76c8f FIR2IR: handle type alias inside GetClassCall 2020-06-23 09:46:47 +03:00
Jinseong Jeon b076bec07f FIR deserializer: signature-aware annotation loading for functions 2020-06-19 10:21:09 +03:00
Mikhail Glukhikh b839a91050 Mute 3 FIR BB tests due to LowPriorityInOverloadResolution in reflect
Recently second javaType function appeared in reflect and
now FIR can't correctly resolve the code :(.
Will be fixed after annotation deserialization full support
2020-06-18 13:39:48 +03:00
Mikhail Glukhikh d009c90e3a Revert "Mute two FIR BB tests due to LowPriorityInOverloadResolution in reflect"
This reverts commit 3768af4f
2020-06-18 13:24:38 +03:00
Mikhail Glukhikh 3768af4f92 Mute two FIR BB tests due to LowPriorityInOverloadResolution in reflect
Recently second javaType function appeared in reflect and
now FIR can't correctly resolve the code :(.
Will be fixed after annotation deserialization full support
2020-06-18 13:21:35 +03:00
Alexander Udalov 117aae8a6b Use experimental javaType in full reflect where it's not supported yet
#KT-22936 Fixed
 #KT-34344 Fixed
2020-06-17 18:33:08 +02:00
Jinseong Jeon ab2a2b3a87 FIR2IR: eager conversion of annotations in Library class and members 2020-06-11 10:57:51 +03:00
Mikhail Glukhikh 6ad37eb7a8 Unmute two more FIR BB tests 2020-06-04 17:26:27 +03:00
Jinseong Jeon 0d6e309372 FIR: construct type with actual type arguments during GetClassCall transformation 2020-06-04 10:13:37 +03:00
Jinseong Jeon 6eb21031b2 FIR JVM serializer: serialize property signature 2020-06-02 12:00:52 +03:00
Jinseong Jeon fd584e6f13 FIR2IR: fix offsets for calls. 2020-05-09 21:11:40 +03:00
Mikhail Glukhikh f3e2dbf360 [FIR2IR] Add conversion of function annotations 2020-05-08 17:30:19 +03:00
Mikhail Glukhikh c6c848f929 Introduce & use FirJvmSerializerExtension & FirBasedClassCodegen
#KT-38156 In Process
2020-04-28 07:34:56 +03:00
Mikhail Glukhikh 96d8b0bea3 FIR: make KFunctionX derived from KFunction 2020-04-20 17:05:37 +03:00
Mikhail Bogdanov dec93c8b49 Add ANDROID target 2020-04-14 13:53:22 +02:00
Jinseong Jeon 08ca6f5f99 [FIR2IR] Set @Metadata when declaring IR symbols 2020-04-06 16:41:57 +03:00
Mikhail Glukhikh 8231377f6b FIR2IR: convert qualifiers inside getClass properly 2020-03-11 16:01:57 +03:00
Mark Punzalan e226561150 [JVM IR] Copy metadata in IrFieldBuilder.
This fixes an issue with lateinit properties where the metadata from
the original field was not copied to the nullable field in
LateinitLowering. Also consolidated related tests.
2020-01-29 17:12:16 +01:00
pyos 88cac53d88 JVM_IR: skip synthetic enum parameters in signatures 2020-01-09 15:58:59 +01:00
Mads Ager 2ebb797e61 JVM_IR: Remove accessor for internal inline class properties. 2020-01-03 15:29:34 +01:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Steven Schäfer 3098723406 Minor: Fix outdated test 2019-10-18 17:20:22 +02:00
Steven Schäfer 9389d88232 JVM IR: Hide constructors with inline class parameters 2019-10-18 17:20:22 +02:00
pyos 432ba62143 JVM_IR: omit annotations on outer this parameters 2019-10-08 14:41:05 +02:00
Ilmir Usmanov 1951ff8054 JVM_IR: Minor. Unmute tests 2019-09-16 16:49:24 +03:00
pyos 54d1df3147 JVM_IR: fix unbound function references 2019-06-25 12:29:23 +02:00
Steven Schäfer 917ef250cf Add and (un)mute inline class tests 2019-06-13 12:25:06 +02:00
Alexander Udalov 4c9e9b1f3a Fix KotlinReflectionInternalError on encountering 'clone' in a class
`RuntimeTypeMapper.mapSignature` threw exception because the descriptor
for `clone` was created manually in CloneableClassScope and therefore it
didn't have a JVM signature as in deserialized descriptors, and wasn't
recognized as a Java method either.

 #KT-22923 Fixed
2019-05-31 12:29:20 +02:00
Mads Ager a8e2893494 JVM_IR: Output EnclosingMethod attribute.
This works in many cases, however, it is incomplete since there
are cases where classes are extracted to top-level and therefore
reparented. Therefore, we lose the information about the function
class are nested inside.
2019-04-10 20:50:03 +02:00
pyos 8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
Alexander Udalov d267f1e875 JVM IR: generate synthetic $annotations methods for properties 2019-02-19 17:25:47 +01:00
Alexander Udalov c357967c2c JVM IR: generate Kotlin metadata
Introduce MetadataSource as a way to store the original descriptor for
any element (before any lowerings) and maintain it until the end of the
codegen where it's used in generating the metadata. Note that JVM
signatures written to the metadata are formed from the _resulting_
generated elements, not by mapping the original descriptors.

Some corner cases are not supported yet, namely properties declared in
companion objects, synthetic methods for property annotations,
JvmPackageName, etc.

 #KT-29119 Fixed
2019-02-19 16:37:47 +01:00
Alexander Udalov 5c807266f6 JVM IR: fix origin of file class in FileClassLowering
IrDeclarationOrigin.FILE_CLASS is used in CallableReferenceLowering to
generate correct declaration owner.

Many reflection tests start to fail with this commit because they are
now treating callable references to top level declarations as Kotlin
symbols and fail because there's no JVM signature for them; this is
fixed in subsequent commits (previously, they worked because without
Kotlin metadata, these files were treated as Java classes)
2019-02-07 21:23:02 +01:00