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:
@@ -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
|
||||
}<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user