Mangle "*" as #STAR, rather than an explicit variance plus a bound.

This commit is contained in:
Alexander Gorshenev
2017-05-10 13:00:15 +03:00
committed by alexander-gorshenev
parent 33189b079f
commit 5d1e6acb7c
@@ -104,15 +104,19 @@ private fun acyclicTypeMangler(visited: MutableSet<TypeParameterDescriptor>, typ
if (bound == "kotlin.Any?") "" else "_$bound" if (bound == "kotlin.Any?") "" else "_$bound"
}.joinToString("") }.joinToString("")
} }
return "GENERIC" + upperBounds return "#GENERIC" + upperBounds
} }
var hashString = TypeUtils.getClassDescriptor(type)!!.fqNameSafe.asString() var hashString = TypeUtils.getClassDescriptor(type)!!.fqNameSafe.asString()
if (!type.arguments.isEmpty()) { if (!type.arguments.isEmpty()) {
hashString += "<${type.arguments.map { hashString += "<${type.arguments.map {
val variance = it.projectionKind.label if (it.isStarProjection()) {
val projection = if (variance == "") "" else "${variance}_" "#STAR"
projection + acyclicTypeMangler(visited, it.type) } else {
val variance = it.projectionKind.label
val projection = if (variance == "") "" else "${variance}_"
projection + acyclicTypeMangler(visited, it.type)
}
}.joinToString(",")}>" }.joinToString(",")}>"
} }