Minor: cleanup + support variance in ErrorListDiagnosticListRenderer
1. Support variance in ErrorListDiagnosticListRenderer. I will make some diagnostics to have covariant type arguments in the next commits 2. Drop unused code Review: https://jetbrains.team/p/kt/reviews/12750/timeline
This commit is contained in:
+6
@@ -13,6 +13,7 @@ import java.io.File
|
||||
import kotlin.reflect.KClass
|
||||
import kotlin.reflect.KType
|
||||
import kotlin.reflect.KTypeProjection
|
||||
import kotlin.reflect.KVariance
|
||||
|
||||
object ErrorListDiagnosticListRenderer : DiagnosticListRenderer() {
|
||||
const val BASE_PACKAGE = "org.jetbrains.kotlin.fir.analysis.diagnostics"
|
||||
@@ -116,6 +117,11 @@ object ErrorListDiagnosticListRenderer : DiagnosticListRenderer() {
|
||||
if (typeArgumentType == null) {
|
||||
print("*")
|
||||
} else {
|
||||
when (typeArgument.variance) {
|
||||
KVariance.INVARIANT, null -> {}
|
||||
KVariance.IN -> print("in ")
|
||||
KVariance.OUT -> print("out ")
|
||||
}
|
||||
printType(typeArgumentType)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user