Commit Graph

43 Commits

Author SHA1 Message Date
Evgeniy.Zhelenskiy b89d8a65a1 [Reflection] Fix parsing JVM function descriptors
#KT-60708
2023-10-19 19:09:31 +00:00
Pavel Kunyavskiy 15e5adf2b5 Mark reflection related tests as jvm-only 2023-06-07 14:59:38 +00:00
Svyatoslav Scherbina 0021333b91 [Native][test] Unmute more passing tests
They now pass likely due to better handling of reflection information
when renaming packages when grouping tests (see cee0731).
2022-08-23 17:05:59 +00:00
Igor Yakovlev a7f0f62f69 [WASM] Generate missing WASM tests and mute failing ones 2021-11-15 19:53:49 +03:00
Mikhail Glukhikh caafe21e84 [FIR] Add CheckLowPriorityStage to callable reference resolve 2020-10-26 20:07:37 +03:00
Vitaly fe047f9b47 [JS BE] mutes tests for JS_IR_ES6, which muted for JS_IR 2020-05-27 00:32:56 +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
Alexander Udalov e533545c29 Minor, ignore codegen test for JDK 6 2020-04-09 16:50:13 +02:00
Alexander Udalov 683489687e Fix NPE in KCallable.isAccessible for interfaces loaded by boot class loader
Class.getClassLoader returns null for classes loaded by the system class
loader (the one used to start the application). In this case we need to
use ClassLoader.getSystemClassLoader. We already have an extension
`safeClassLoader` specifically for this purpose in reflection.jvm, but
forgot to use it in d59f2bcc80.

 #KT-37707 Fixed
2020-04-09 12:35:28 +02:00
Jinseong Jeon 3e6b38a921 [FIR] Fix type reference for 1st arg of GetClassCall 2020-04-02 12:42:50 +03:00
Juan Chen 9dd8eda1c9 [FIR]: fix library methods in packages
Library methods such as 'listOf' are resolved
to have the package fragments as their parents,
but JVM expects their containing file classes as parents.
This fix generates those file classes and
uses them as parent replacements for such library methods.
2020-02-20 14:24:02 +03:00
Roman Artemev e57d34dd9e Make fix test:
- [JS IR] Unmute fixed tests
 - [IrText] Update testdata
 - [WASM] Temporary turn wasm test off
 - [FirText] Temporary turn fit text tests off
 - [JVM IR] Turn off klib jvm test
 - [IR] Add new test
2020-02-14 18:22:17 +03:00
Ilya Gorbunov 0f6df5971b Mute tests failing in JS_IR backend due to KT-35944 2020-01-16 15:36:16 +03:00
Steven Schäfer 929fb5c82b Mute FIR tests containing broken function calls 2020-01-08 13:20:00 +01:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Ilya Gorbunov 7573fcde53 Demote new experimental capitalize overloads in overload resolution
Revert "Fix method reference ambiguity in test after introducing 'capitalize' overload"
This reverts commit fe9bd9ee
2019-07-09 03:39:25 +03:00
pyos 54d1df3147 JVM_IR: fix unbound function references 2019-06-25 12:29:23 +02:00
Ilya Gorbunov fe9bd9ee20 Fix method reference ambiguity in test after introducing 'capitalize' overload 2019-05-29 06:49:05 +03: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
Mikhael Bogdanov f2a51d3b80 Support reflection tests on Android 2019-01-26 08:26:49 +01:00
Mikhael Bogdanov 3e6f8db975 Specify JVM target backend for test with 'import kotlin.reflect.jvm' 2018-12-21 16:09:09 +01:00
Mikhael Bogdanov f4e532e449 Specify JVM target backend for test with '@JvmXXX' annotations 2018-12-21 16:09:07 +01:00
Mikhael Bogdanov a8a1bfca72 Specify JVM target backend for test with '// File: *.java' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov 357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Roman Artemev c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00
Mikhael Bogdanov 2884d728fd Mute/unmute jvm_ir tests 2018-08-01 12:29:24 +02:00
Alexander Udalov 4266e50be8 Use manual type mapping in reflection for members from built-ins
There are cases when members deserialized from JVM classes have no JVM
signature in the proto. For example, if a member is inherited from a
built-in class (such as Map.getOrDefault in some Map implementations),
or if a member is synthesized in the compiler front-end and back-end
separately (such as enum values/valueOf). In these cases, we'll use the
naive type mapping to try to recover the signature.

 #KT-16616 Fixed
 #KT-17542 Fixed
2018-07-02 18:49:08 +02:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Anton Bannykh 96355e2732 JS IR: mute codegen box tests automatically 2018-06-09 19:15:38 +03:00
Alexander Udalov 60c735f2fd Do not use deprecated kotlin.reflect API 2017-09-12 15:08:21 +03:00
Ilya Matveev a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00
Alexander Udalov 7147008e21 Fix functionFromStdlib.kt by making the member accessible
#KT-16263 Open
2017-02-09 14:56:27 +03:00
Alexander Udalov ccbfa2e81d Fix Member.getKPackage and temporarily revert functionFromStdlib.kt 2017-02-08 20:02:49 +03:00
Alexander Udalov 6d16ea0a3a Fix reflection on top level declarations from other modules
The main problem here is that moduleName that is being passed to KPackageImpl
is useless: as can be seen in
ClosureCodegen.generateCallableReferenceDeclarationContainer, the name of the
current module is always written to the class file for a callable reference,
not the name of the module of the referenced declaration. This resulted in
reflection not loading the correct .kotlin_module file and subsequently not
finding the required file facade for a top-level function.

The commit does not fix the issue with the incorrect module name written in the
back-end, but workarounds it. It turns out, reflection can figure out the name
of the module of the referenced declaration itself by parsing the header from
the given java.lang.Class object for a single-file/multi-file package facade
and extract the package_module_name protobuf extension. Similar code was
already there in Member.getKPackage() in ReflectJvmMapping.kt but it did not
support multi-file classes, of which there are a lot in the standard library;
this is now supported

 #KT-12630 Fixed
 #KT-14731 Fixed
2017-02-08 19:23:18 +03:00
Alexey Andreev dcb8b7b92c JS: fix inlining of callable references 2017-01-24 20:09:30 +03:00
Anton Bannykh 07bb7ef4d3 JS: extension lambdas translated same as local lambdas (KT-13312 fixed) 2017-01-23 20:09:36 +03:00
Ilya Gorbunov 0899a0fdda Make some tests JVM only 2016-11-21 18:20:33 +03:00
Zalim Bashorov 596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Alexander Udalov a10cf8a931 Support 'is/as FunctionN<...>' and 'invoke' for KFunction instances 2016-09-13 14:12:31 +03:00
Alexander Udalov 90eafe0d71 Fix reflective access on overridden generic property reference
Generation of callable reference's signature in codegen should use the same
mechanism for obtaining the signature as the runtime in RuntimeTypeMapper,
namely DescriptorUtils.unwrapFakeOverride(...).original

 #KT-13700 Fixed
2016-09-12 10:39:21 +03:00
Alexander Udalov f8dfaf4599 Merge boxWithJava testData into box, delete BoxWithJava test 2016-03-09 10:25:38 +03:00
Alexander Udalov 06a67e6602 Merge boxWithStdlib testData into box, delete BoxWithStdlib test 2016-03-09 10:25:38 +03:00