[FIR-IDE] Fix generating conversions for pair with non-trivial converters
This commit is contained in:
committed by
teamcityserver
parent
b363d95160
commit
faadb08174
+8
-1
@@ -90,7 +90,14 @@ class HLPairParameterConversion(
|
|||||||
private val mappingConversionFirst: HLParameterConversion,
|
private val mappingConversionFirst: HLParameterConversion,
|
||||||
private val mappingConversionSecond: HLParameterConversion,
|
private val mappingConversionSecond: HLParameterConversion,
|
||||||
) : HLParameterConversion() {
|
) : HLParameterConversion() {
|
||||||
override fun convertExpression(expression: String, context: ConversionContext): String = expression
|
override fun convertExpression(expression: String, context: ConversionContext): String {
|
||||||
|
if (mappingConversionFirst.isTrivial && mappingConversionSecond.isTrivial) {
|
||||||
|
return expression
|
||||||
|
}
|
||||||
|
val first = mappingConversionFirst.convertExpression("$expression.first", context)
|
||||||
|
val second = mappingConversionSecond.convertExpression("$expression.second", context)
|
||||||
|
return "$first to $second"
|
||||||
|
}
|
||||||
|
|
||||||
override fun convertType(type: KType): KType {
|
override fun convertType(type: KType): KType {
|
||||||
val first = type.arguments.getOrNull(0)?.type ?: return type
|
val first = type.arguments.getOrNull(0)?.type ?: return type
|
||||||
|
|||||||
Reference in New Issue
Block a user