Review fixes

This commit is contained in:
Igor Chevdar
2017-02-22 14:25:16 +03:00
parent 174b8ee601
commit 2bfd6cf19f
2 changed files with 7 additions and 4 deletions
@@ -71,6 +71,7 @@ internal class SpecialDescriptorsFactory(val context: Context) {
bridgeDescriptor.initialize( bridgeDescriptor.initialize(
extensionReceiverType, extensionReceiverType,
// TODO: bug in descriptor - https://youtrack.jetbrains.com/issue/KT-16438.
(descriptor.containingDeclaration as ClassDescriptor).thisAsReceiverParameter, (descriptor.containingDeclaration as ClassDescriptor).thisAsReceiverParameter,
descriptor.typeParameters, descriptor.typeParameters,
descriptor.valueParameters.mapIndexed { index, valueParameterDescriptor -> descriptor.valueParameters.mapIndexed { index, valueParameterDescriptor ->
@@ -240,13 +240,15 @@ internal class BridgeDirections(val array: Array<BridgeDirection>) {
fun allNotNeeded(): Boolean = array.all { it == BridgeDirection.NOT_NEEDED } fun allNotNeeded(): Boolean = array.all { it == BridgeDirection.NOT_NEEDED }
override fun toString(): String { override fun toString(): String {
return String(array.map { val result = StringBuilder()
when (it) { array.forEach {
result.append(when (it) {
BridgeDirection.FROM_VALUE_TYPE -> 'U' // unbox BridgeDirection.FROM_VALUE_TYPE -> 'U' // unbox
BridgeDirection.TO_VALUE_TYPE -> 'B' // box BridgeDirection.TO_VALUE_TYPE -> 'B' // box
BridgeDirection.NOT_NEEDED -> 'N' // none BridgeDirection.NOT_NEEDED -> 'N' // none
} })
}.toCharArray()) }
return result.toString()
} }
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {