From 0340c218b91d6d333a3521c3401e2774fd51e435 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Tue, 12 Mar 2019 12:24:54 +0300 Subject: [PATCH] New J2K: Do not show unknown comment for some kind of type types --- nj2k/src/org/jetbrains/kotlin/nj2k/NewCodeBuilder.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nj2k/src/org/jetbrains/kotlin/nj2k/NewCodeBuilder.kt b/nj2k/src/org/jetbrains/kotlin/nj2k/NewCodeBuilder.kt index e500ddaf25c..af6cd5091d7 100644 --- a/nj2k/src/org/jetbrains/kotlin/nj2k/NewCodeBuilder.kt +++ b/nj2k/src/org/jetbrains/kotlin/nj2k/NewCodeBuilder.kt @@ -641,6 +641,9 @@ class NewCodeBuilder { private fun renderType(type: JKType) { if (type is JKNoTypeImpl) return + if (type.nullability == Nullability.Default) { + printer.print("/*UNDEFINED*/") + } when (type) { is JKClassType -> printer.printWithNoIndent(type.classReference.displayName().escapedAsQualifiedName()) is JKContextType -> return @@ -659,14 +662,11 @@ class NewCodeBuilder { } if (type is JKParametrizedType && type.parameters.isNotEmpty()) { printer.par(ANGLE) { - renderList(type.parameters, renderElement = ::renderType) + renderList(type.parameters, renderElement = { renderType(it) }) } } - when (type.nullability) { - Nullability.Nullable -> printer.printWithNoIndent("?") - Nullability.Default -> printer.printWithNoIndent("?")// /* TODO: Default */") - else -> { - } + if (type.nullability == Nullability.Nullable) { + printer.printWithNoIndent("?") } }