FIR: Make replace function accepting parameter with nullability as-is

This commit is contained in:
Denis Zharkov
2020-02-03 20:23:27 +03:00
parent 23e9a0c861
commit c3e900b945
6 changed files with 7 additions and 9 deletions
@@ -67,7 +67,7 @@ fun transformFunctionDeclaration(transformName: String, returnType: String): Str
fun Field.replaceFunctionDeclaration(): String {
val capName = name.capitalize()
return "fun replace$capName(new$capName: $typeWithArgumentsWithoutNullablity)"
return "fun replace$capName(new$capName: $typeWithArguments)"
}
val Field.mutableType: String
@@ -107,8 +107,6 @@ val Importable.typeWithArguments: String
else -> throw IllegalArgumentException()
}
val Importable.typeWithArgumentsWithoutNullablity: String get() = typeWithArguments.dropLastWhile { it == '?' }
val ImplementationWithArg.generics: String
get() = argument?.let { "<${it.type}>" } ?: ""
@@ -128,4 +126,4 @@ val Element.typeParameters: String
?: ""
val Type.generics: String
get() = arguments.takeIf { it.isNotEmpty() }?.joinToString(",", "<", ">") ?: ""
get() = arguments.takeIf { it.isNotEmpty() }?.joinToString(",", "<", ">") ?: ""