Convert to Expression Body Intention: Do not remove declaration type if it affects the type of body expression

This commit is contained in:
Alexey Sedunov
2015-03-12 17:48:10 +03:00
parent 9cb42944d1
commit bff709da10
5 changed files with 34 additions and 13 deletions
@@ -5,4 +5,4 @@ fun foo(t: Array<Int>) {
t.check(function())
}
private fun function() = { it + 1 > 1 }
private fun function(): (Int) -> Boolean = { it + 1 > 1 }
@@ -5,4 +5,4 @@ fun foo(t: Array<Int>) {
t.check(function())
}
private fun function() = { it + 1 > 1 }
private fun function(): (Int) -> Boolean = { it + 1 > 1 }
@@ -5,4 +5,4 @@ fun foo(t: Array<Int>) {
t.check(1, 2, function())
}
private fun function() = { it + 1 > 1 }
private fun function(): (Int) -> Boolean = { it + 1 > 1 }
@@ -5,4 +5,4 @@ fun foo(t: Array<Int>) {
t.check(a = 1, b = 2, f = function())
}
private fun function() = { it + 1 > 1 }
private fun function(): (Int) -> Boolean = { it + 1 > 1 }