Temporary add jvm.overloads annotation for generated joinToString() method.
Stdlib generator: allow to specify arbitrary annotations for all or some of generic function expansions.
This commit is contained in:
@@ -84,6 +84,7 @@ class GenericFunction(val signature: String, val keyword: String = "fun") : Comp
|
||||
override fun onKeySet(key: Family) = include(key)
|
||||
}
|
||||
val customPrimitiveBodies = HashMap<Pair<Family, PrimitiveType>, String>()
|
||||
val annotations = FamilyProperty<String>()
|
||||
|
||||
fun bodyForTypes(family: Family, vararg primitiveTypes: PrimitiveType, b: () -> String) {
|
||||
include(family)
|
||||
@@ -295,6 +296,8 @@ class GenericFunction(val signature: String, val keyword: String = "fun") : Comp
|
||||
?.let { platformName -> builder.append("platformName(\"${platformName}\")\n")}
|
||||
}
|
||||
|
||||
annotations[f]?.let { builder.append(it).append('\n') }
|
||||
|
||||
builder.append("public ")
|
||||
if (inline[f] == true)
|
||||
builder.append("inline ")
|
||||
|
||||
@@ -63,6 +63,7 @@ fun strings(): List<GenericFunction> {
|
||||
|
||||
exclude(Strings)
|
||||
returns("String")
|
||||
annotations("kotlin.jvm.overloads", Iterables)
|
||||
body {
|
||||
"""
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()
|
||||
|
||||
Reference in New Issue
Block a user