KT-10139: any if without else used in expression is an error

regardless of expected type: it can't be an expression, even of type Unit.

 #KT-10139 Fixed
This commit is contained in:
Dmitry Petrov
2015-11-27 16:06:11 +03:00
parent b0dab4c67a
commit 1a3a296827
8 changed files with 155 additions and 16 deletions
@@ -4,7 +4,7 @@ fun test(a: Boolean, b: Boolean): Int {
return if(a) {
1
} else {
<!TYPE_MISMATCH!>if (b) {
<!TYPE_MISMATCH, INVALID_IF_AS_EXPRESSION!>if (b) {
3
}<!>
}