Return kotlin ctor mapped to a java ctor even if java ctor is synthetic

This allows working with constructors with inline class parameters using
Kotlin reflection, as described in
https://youtrack.jetbrains.com/issue/KT-27429#focus=streamItem-27-3161148-0-0

 #KT-27913
 #KT-27429
This commit is contained in:
Dmitry Petrov
2018-11-19 13:00:15 +03:00
parent 9082f19c00
commit 3efb07bf7b
7 changed files with 46 additions and 2 deletions
@@ -144,7 +144,5 @@ val Method.kotlinFunction: KFunction<*>?
*/
val <T : Any> Constructor<T>.kotlinFunction: KFunction<T>?
get() {
if (isSynthetic) return null
return declaringClass.kotlin.constructors.firstOrNull { it.javaConstructor == this }
}