New J2K: Add NoType for ktProperty
This commit is contained in:
committed by
Ilya Kirillov
parent
a55d2b6597
commit
77713c1877
@@ -271,7 +271,7 @@ class JavaToJKTreeBuilder(var symbolProvider: JKSymbolProvider) {
|
|||||||
fun PsiField.toJK(): JKJavaField {
|
fun PsiField.toJK(): JKJavaField {
|
||||||
return JKJavaFieldImpl(
|
return JKJavaFieldImpl(
|
||||||
with(modifierMapper) { modifierList.toJK(finalAsMutability = true) },
|
with(modifierMapper) { modifierList.toJK(finalAsMutability = true) },
|
||||||
with(expressionTreeMapper) { typeElement?.toJK() } ?: TODO(),
|
with(expressionTreeMapper) { typeElement?.toJK() } ?: JKTypeElementImpl(JKNoTypeImpl),
|
||||||
JKNameIdentifierImpl(name),
|
JKNameIdentifierImpl(name),
|
||||||
with(expressionTreeMapper) { initializer.toJK() }
|
with(expressionTreeMapper) { initializer.toJK() }
|
||||||
).also {
|
).also {
|
||||||
|
|||||||
@@ -229,10 +229,15 @@ class NewCodeBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun visitKtProperty(ktProperty: JKKtProperty) {
|
override fun visitKtProperty(ktProperty: JKKtProperty) {
|
||||||
ktProperty.modifierList.accept(this)
|
ktProperty.modifierList.accept(this)
|
||||||
|
|
||||||
printer.printWithNoIndent(" ", ktProperty.name.value, ": ")
|
printer.printWithNoIndent(" ", ktProperty.name.value)
|
||||||
|
if (ktProperty.type.type != JKNoTypeImpl) {
|
||||||
|
printer.printWithNoIndent(":")
|
||||||
|
ktProperty.type.accept(this)
|
||||||
|
}
|
||||||
ktProperty.type.accept(this)
|
ktProperty.type.accept(this)
|
||||||
if (ktProperty.initializer !is JKStubExpression) {
|
if (ktProperty.initializer !is JKStubExpression) {
|
||||||
printer.printWithNoIndent(" = ")
|
printer.printWithNoIndent(" = ")
|
||||||
|
|||||||
Reference in New Issue
Block a user