diff --git a/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt b/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt index e3911e4eb..7b7895416 100644 --- a/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt +++ b/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt @@ -42,8 +42,9 @@ class LinChecker (private val testClass: Class<*>, options: Options<*, *>?) { * @throws LincheckAssertionError if the testing data structure is incorrect. */ fun check() { - val failure = checkImpl() ?: return - throw LincheckAssertionError(failure) + checkImpl { failure -> + if (failure != null) throw LincheckAssertionError(failure) + } } /**