Kotlin: Implement JvmOverloads annotation

This generates functions that omit parameters with default values, rightmost first, such that Java can achieve a similar experience to Kotlin (which represents calls internally as if the default was supplied explicitly, and/or uses a $default method that supplies the needed arguments).

A complication: combining JvmOverloads with JvmStatic means that both the companion object and the surrounding class get overloads.
This commit is contained in:
Chris Smowton
2022-07-12 19:39:24 +01:00
parent d52d3d7b75
commit d3d3ce843a
23 changed files with 1261 additions and 67 deletions

View File

@@ -63,6 +63,8 @@ class Element extends @element, Top {
i = 7 and result = "Setter for a Kotlin delegated property"
or
i = 8 and result = "Proxy static method for a @JvmStatic-annotated function or property"
or
i = 9 and result = "Forwarder for a @JvmOverloads-annotated function"
)
}
}