Apply infix modifier on functions from stdlib where appropriate.
This commit is contained in:
@@ -528,4 +528,4 @@ fun merge(i1: InterfaceDefinition, i2: InterfaceDefinition): InterfaceDefinition
|
||||
)
|
||||
}
|
||||
|
||||
fun <T> List<T>.merge(other: List<T>) = (this + other).distinct().toList()
|
||||
infix fun <T> List<T>.merge(other: List<T>) = (this + other).distinct()
|
||||
|
||||
@@ -59,11 +59,9 @@ private fun String.replaceWrongConstants(type: Type) = when {
|
||||
private fun String.replaceKeywords() = if (this in keywords) this + "_" else this
|
||||
|
||||
private fun Appendable.renderArgumentsDeclaration(args: List<GenerateAttribute>, omitDefaults: Boolean = false) =
|
||||
args.map {
|
||||
StringBuilder {
|
||||
renderAttributeDeclaration(it, it.override, false, omitDefaults)
|
||||
}
|
||||
}.joinTo(this, ", ", "(", ")")
|
||||
args.joinTo(this, ", ", "(", ")") {
|
||||
StringBuilder().apply { renderAttributeDeclaration(it, it.override, false, omitDefaults) }
|
||||
}
|
||||
|
||||
private fun renderCall(call: GenerateFunctionCall) = "${call.name.replaceKeywords()}(${call.arguments.joinToString(", ") { it.replaceKeywords() }})"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user