Error on 'if' without an 'else' branch when used as an expression
This commit is contained in:
+7
-2
@@ -1,5 +1,10 @@
|
||||
fun unsupportedEx() = if (true) throw UnsupportedOperationException()
|
||||
fun runtimeEx() = if (true) throw RuntimeException()
|
||||
fun unsupportedEx() {
|
||||
if (true) throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
fun runtimeEx() {
|
||||
if (true) throw RuntimeException()
|
||||
}
|
||||
|
||||
fun test1() : String {
|
||||
var s = "";
|
||||
|
||||
+7
-2
@@ -1,5 +1,10 @@
|
||||
fun unsupportedEx() = if (true) throw UnsupportedOperationException()
|
||||
fun runtimeEx() = if (true) throw RuntimeException()
|
||||
fun unsupportedEx() {
|
||||
if (true) throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
fun runtimeEx() {
|
||||
if (true) throw RuntimeException()
|
||||
}
|
||||
|
||||
fun test1WithFinally() : String {
|
||||
var s = "";
|
||||
|
||||
Reference in New Issue
Block a user