Do not force new line in body for empty functions and function expressions (KT-10828)

#KT-10828 Fixed
This commit is contained in:
Nikolay Krasko
2016-12-06 16:39:17 +03:00
committed by Nikolay Krasko
parent 268d55104c
commit 2841931ffa
130 changed files with 334 additions and 575 deletions
@@ -1,6 +1,5 @@
internal class C {
private fun foo(s: String?) {
}
private fun foo(s: String?) {}
fun bar() {
foo(null)
@@ -1,6 +1,5 @@
internal class C {
fun foo(s: String?) {
}
fun foo(s: String?) {}
}
internal class D {
@@ -1,6 +1,5 @@
internal class C {
private fun foo(s: String?) {
}
private fun foo(s: String?) {}
fun bar(b: Boolean) {
foo(if (b) "a" else null)
@@ -1,11 +1,9 @@
// ERROR: There's a cycle in the inheritance hierarchy for this type
// ERROR: There's a cycle in the inheritance hierarchy for this type
internal open class A : B() {
open fun foo(s: String) {
}
open fun foo(s: String) {}
}
internal open class B : A() {
open fun foo(s: String) {
}
open fun foo(s: String) {}
}
+2 -4
View File
@@ -23,9 +23,7 @@ class Passenger {
accept2(pass as PassChild?)
}
fun accept1(p: PassChild) {
}
fun accept1(p: PassChild) {}
fun accept2(p: PassChild) {
}
fun accept2(p: PassChild) {}
}