KT-1156 Throwing exception on the right side of elvis operator marks code unreachable

This commit is contained in:
svtk
2012-01-26 12:58:14 +04:00
parent 020fdfddb9
commit 7678815f17
2 changed files with 19 additions and 0 deletions
@@ -0,0 +1,8 @@
//KT-1156 Throwing exception on the right side of elvis operator marks code unreachable
//+JDK
fun foo(maybe: Int?) {
val i : Int = maybe ?: throw RuntimeException("No value")
System.out?.println(i)
}