JS: when none of exhaustive when clauses match, generate code that throws exception. See KT-12194
This commit is contained in:
@@ -33,4 +33,7 @@ internal fun arrayIterator(array: dynamic): MutableIterator<dynamic> {
|
||||
}
|
||||
|
||||
@JsName("PropertyMetadata")
|
||||
internal class PropertyMetadata(val name: String)
|
||||
internal class PropertyMetadata(val name: String)
|
||||
|
||||
@JsName("noWhenBranchMatched")
|
||||
internal fun noWhenBranchMatched(): Nothing = throw NoWhenBranchMatchedException()
|
||||
@@ -41,3 +41,5 @@ public open class ClassCastException(message: String? = null) : RuntimeException
|
||||
public open class AssertionError(message: String? = null) : Error(message)
|
||||
|
||||
public open class NoSuchElementException(message: String? = null) : Exception(message)
|
||||
|
||||
public open class NoWhenBranchMatchedException(message: String? = null) : RuntimeException(message)
|
||||
|
||||
Reference in New Issue
Block a user