Implement KTypeProjection.toString

The implementation is checked by tests on typeOf.

 #KT-30071 Fixed
This commit is contained in:
Alexander Udalov
2020-01-21 11:58:59 +01:00
parent 3a90e2dd75
commit e34a207725
2 changed files with 9 additions and 3 deletions
@@ -71,6 +71,13 @@ public data class KTypeProjection constructor(
*/
public val type: KType?
) {
override fun toString(): String = when (variance) {
null -> "*"
KVariance.INVARIANT -> type.toString()
KVariance.IN -> "in $type"
KVariance.OUT -> "out $type"
}
public companion object {
/**
* Star projection, denoted by the `*` character.