Zac Sweers
09/28/2020, 3:31 PMephemient
09/28/2020, 5:11 PM@kotlin.Metadata
annotations to simulate a Kotlin file defining an inline function with bytecode to call the synthetic constructor?Ting-Yuan Huang
09/28/2020, 9:03 PMZac Sweers
09/28/2020, 9:06 PMZac Sweers
09/28/2020, 9:07 PMZac Sweers
09/28/2020, 9:07 PMZac Sweers
09/28/2020, 9:08 PMZac Sweers
09/28/2020, 9:08 PMZac Sweers
09/28/2020, 9:09 PMZac Sweers
09/28/2020, 9:11 PMshikasd
09/28/2020, 10:16 PMTing-Yuan Huang
09/28/2020, 11:09 PMTing-Yuan Huang
09/28/2020, 11:46 PMTing-Yuan Huang
09/28/2020, 11:51 PMTing-Yuan Huang
09/29/2020, 12:00 AM@JvmOverloads
for the processor:
https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#overloads-generation
Having said that, bytecode generation is probably still not needed. The function with mask is public and should be callable (although not recommended) in Java as well. Pardon me if I still get you wrong.Zac Sweers
09/29/2020, 5:03 PMLooks like that the default constructor is only generated when all parameters have default values.This isn’t quite true, it will be generated when any of them have a default parameter.
the compiler should transform all the call sites to the target with mask. I think you can simply generate calls in Kotlin and don’t have to worry about the default arguments.Normally yes, but in our case we don’t know until runtime which arguments are present. That’s why we do this with reflection for now. This is effectively recreating the behavior of kotlin-reflect’s
KFunction.callBy()
functionalityTing-Yuan Huang
09/30/2020, 11:11 PMZac Sweers
09/30/2020, 11:13 PMTing-Yuan Huang
09/30/2020, 11:14 PMZac Sweers
10/01/2020, 1:12 AM