Fix generic overrides conflicts. (#1293)
This commit is contained in:
+5
-3
@@ -154,15 +154,17 @@ private val FunctionDescriptor.signature: String
|
|||||||
typeToHashString(it.type)
|
typeToHashString(it.type)
|
||||||
}.joinToString(";")
|
}.joinToString(";")
|
||||||
|
|
||||||
// Just distinguish value types and references - it's needed for calling virtual methods through bridges.
|
// Distinguish value types and references - it's needed for calling virtual methods through bridges.
|
||||||
val returnTypePart =
|
// Also is function has type arguments - frontend allows exactly matching overrides.
|
||||||
|
val signatureSuffix =
|
||||||
when {
|
when {
|
||||||
|
this.typeParameters.isNotEmpty() -> "Generic"
|
||||||
returnType.let { it != null && it.isValueType() } -> "ValueType"
|
returnType.let { it != null && it.isValueType() } -> "ValueType"
|
||||||
returnType.let { it != null && !KotlinBuiltIns.isUnitOrNullableUnit(it) } -> "Reference"
|
returnType.let { it != null && !KotlinBuiltIns.isUnitOrNullableUnit(it) } -> "Reference"
|
||||||
else -> ""
|
else -> ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return "$extensionReceiverPart($argsPart)$returnTypePart"
|
return "$extensionReceiverPart($argsPart)$signatureSuffix"
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: rename to indicate that it has signature included
|
// TODO: rename to indicate that it has signature included
|
||||||
|
|||||||
Reference in New Issue
Block a user