diff --git a/kunit/src/main/kotlin/Test.kt b/kunit/src/main/kotlin/Test.kt index 30fbd211eca..e094a0066fc 100644 --- a/kunit/src/main/kotlin/Test.kt +++ b/kunit/src/main/kotlin/Test.kt @@ -65,7 +65,7 @@ inline fun expect(expected: T, message: String, block: ()-> T) { } /** Asserts that given function block fails by throwing an exception */ -fun fails(block: ()-> Any): Exception? { +fun fails(block: ()-> Unit): Exception? { try { block() Assert.fail("Expected an exception to be thrown")