Do not force new line in body for empty functions and function expressions (KT-10828)
#KT-10828 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
268d55104c
commit
2841931ffa
@@ -7,11 +7,8 @@ internal class Customer(val firstName: String, val lastName: String) {
|
||||
doSmthAfter()
|
||||
}
|
||||
|
||||
private fun doSmthBefore() {
|
||||
}
|
||||
|
||||
private fun doSmthAfter() {
|
||||
}
|
||||
private fun doSmthBefore() {}
|
||||
private fun doSmthAfter() {}
|
||||
}
|
||||
|
||||
internal class CustomerBuilder {
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
internal open class Base
|
||||
|
||||
internal class C : Base {
|
||||
constructor(arg1: Int, arg2: Int, arg3: Int) {
|
||||
}
|
||||
constructor(arg1: Int, arg2: Int, arg3: Int) {}
|
||||
|
||||
constructor(arg1: Int, arg2: Int) : this(arg1, arg2, 0) {
|
||||
println()
|
||||
|
||||
@@ -2,6 +2,5 @@ package pack
|
||||
|
||||
internal class C @JvmOverloads constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
|
||||
|
||||
constructor(a: Int) : this(a, 0, 0, 0, 1) {
|
||||
}
|
||||
constructor(a: Int) : this(a, 0, 0, 0, 1) {}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@ package pack
|
||||
|
||||
internal class C @JvmOverloads constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
|
||||
|
||||
constructor(a1: Int, b1: Int, c1: Int) : this(a1, b1, c1, 0, 0) {
|
||||
}
|
||||
constructor(a1: Int, b1: Int, c1: Int) : this(a1, b1, c1, 0, 0) {}
|
||||
|
||||
constructor(b: Byte) : this(b.toInt(), 0, 0, 0, 0) {
|
||||
}
|
||||
constructor(b: Byte) : this(b.toInt(), 0, 0, 0, 0) {}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@ package pack
|
||||
|
||||
internal class C @JvmOverloads constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
|
||||
|
||||
constructor(a: Int, b: Int, c: Int) : this(b, a, c, 0, 0) {
|
||||
}
|
||||
constructor(a: Int, b: Int, c: Int) : this(b, a, c, 0, 0) {}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
internal class C private constructor(arg1: Int, arg2: Int, arg3: Int = 0) {
|
||||
|
||||
constructor(arg1: Int) : this(arg1, 0, 0) {
|
||||
}
|
||||
constructor(arg1: Int) : this(arg1, 0, 0) {}
|
||||
}
|
||||
|
||||
+1
-2
@@ -4,8 +4,7 @@ internal class A {
|
||||
private val s = ""
|
||||
private val x = 0
|
||||
|
||||
constructor() {
|
||||
}
|
||||
constructor() {}
|
||||
|
||||
@JvmOverloads constructor(p: Int, s: String, x: Int = 1) {
|
||||
this.s = s
|
||||
|
||||
+12
-24
@@ -1,51 +1,39 @@
|
||||
internal class Outer {
|
||||
private inner class Inner1() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {
|
||||
}
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
protected inner class Inner2() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {
|
||||
}
|
||||
private constructor(b: Boolean) : this() {}
|
||||
|
||||
}
|
||||
|
||||
internal inner class Inner3() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {
|
||||
}
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
inner class Inner4() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {
|
||||
}
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
|
||||
+12
-24
@@ -2,51 +2,39 @@
|
||||
internal object Outer {
|
||||
private class Nested1() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {
|
||||
}
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
protected class Nested2() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {
|
||||
}
|
||||
private constructor(b: Boolean) : this() {}
|
||||
|
||||
}
|
||||
|
||||
internal class Nested3() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {
|
||||
}
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
class Nested4() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
private constructor(b: Boolean) : this() {
|
||||
}
|
||||
private constructor(b: Boolean) : this() {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
|
||||
+8
-16
@@ -1,29 +1,21 @@
|
||||
internal class A() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
constructor(f: Float) : this() {
|
||||
}
|
||||
constructor(f: Float) : this() {}
|
||||
|
||||
private constructor(d: Double) : this() {
|
||||
}
|
||||
private constructor(d: Double) : this() {}
|
||||
}
|
||||
|
||||
class B() {
|
||||
|
||||
constructor(a: Int) : this() {
|
||||
}
|
||||
constructor(a: Int) : this() {}
|
||||
|
||||
protected constructor(c: Char) : this() {
|
||||
}
|
||||
protected constructor(c: Char) : this() {}
|
||||
|
||||
internal constructor(f: Float) : this() {
|
||||
}
|
||||
internal constructor(f: Float) : this() {}
|
||||
|
||||
private constructor(d: Double) : this() {
|
||||
}
|
||||
private constructor(d: Double) : this() {}
|
||||
}
|
||||
@@ -9,8 +9,7 @@ class Test {
|
||||
protected var f: Short = 0
|
||||
protected var g: Char = ' '
|
||||
|
||||
constructor() {
|
||||
}
|
||||
constructor() {}
|
||||
|
||||
constructor(name: String) {
|
||||
myName = foo(name)
|
||||
|
||||
Reference in New Issue
Block a user