New J2K: print new line before init section because of bad formatting

This commit is contained in:
Ilya Kirillov
2019-06-05 19:14:24 +03:00
parent ca23eb44a1
commit 201bf328ca
2 changed files with 3 additions and 2 deletions
@@ -342,6 +342,7 @@ class NewCodeBuilder(context: NewJ2kConverterContext) {
override fun visitKtInitDeclarationRaw(ktInitDeclaration: JKKtInitDeclaration) {
if (ktInitDeclaration.block.statements.isNotEmpty()) {
printer.println()
printer.print("init ")
ktInitDeclaration.block.accept(this)
}
+2 -2
View File
@@ -16,10 +16,10 @@ internal class A @JvmOverloads constructor(p: Int = 1) {
// end of secondary constructor 1 body
}
internal class B // this constructor will disappear
// end of constructor body
internal class B // end of constructor body
(private val x: Int) {
fun foo() {}
// this constructor will disappear
}