Introduce 'fail' method to throw AssertionError with cause

#KT-37804
This commit is contained in:
Ilya Gorbunov
2020-01-26 00:02:43 +03:00
parent d2ff98fcb1
commit 2bb36899da
11 changed files with 95 additions and 13 deletions
@@ -80,7 +80,9 @@ public actual open class ClassCastException actual constructor(message: String?)
actual constructor() : this(null)
}
public actual open class AssertionError private constructor(message: String?, cause: Throwable?) : Error(message, cause) {
public actual open class AssertionError
@SinceKotlin("1.4")
constructor(message: String?, cause: Throwable?) : Error(message, cause) {
actual constructor() : this(null)
constructor(message: String?) : this(message, null)
actual constructor(message: Any?) : this(message.toString(), message as? Throwable)