Alphabetical sort wrapped intersection types for rendered diagnostics

This commit is contained in:
victor.petukhov
2018-12-28 14:54:11 +03:00
parent 30762a450a
commit cb5f497cbe
2 changed files with 4 additions and 4 deletions
@@ -1,7 +1,7 @@
package
public fun bar(/*0*/ b: B): kotlin.String
public fun foo(/*0*/ b: B): {A & C & B}?
public fun foo(/*0*/ b: B): {A & B & C}?
public fun gav(/*0*/ b: B): A?
public interface A {
@@ -25,10 +25,10 @@ public interface C {
public final class My {
public constructor My(/*0*/ b: B)
public final val x: {A & C & B}?
public final val x: {A & B & C}?
public final val y: C?
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(/*0*/ b: B): {A & C & B}?
public final fun foo(/*0*/ b: B): {A & B & C}?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -51,7 +51,7 @@ class IntersectionTypeConstructor(typesToIntersect: Collection<KotlinType>) : Ty
makeDebugNameForIntersectionType(intersectedTypes)
private fun makeDebugNameForIntersectionType(resultingTypes: Iterable<KotlinType>): String =
resultingTypes.joinToString(separator = " & ", prefix = "{", postfix = "}")
resultingTypes.sortedBy { it.toString() }.joinToString(separator = " & ", prefix = "{", postfix = "}")
override fun equals(other: Any?): Boolean {
if (this === other) return true