mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-05 08:31:31 +00:00
Mark reified assertFailsWith with InlineOnly to preserve stack traces.
This commit is contained in:
@@ -28,6 +28,7 @@ fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: String?,
|
||||
/** Asserts that a [block] fails with a specific exception of type [T] being thrown.
|
||||
* Since inline method doesn't allow to trace where it was invoked, it is required to pass a [message] to distinguish this method call from others.
|
||||
*/
|
||||
@kotlin.internal.InlineOnly
|
||||
inline fun <reified T : Throwable> assertFailsWith(message: String? = null, noinline block: () -> Unit): T = assertFailsWith(T::class, message, block)
|
||||
|
||||
|
||||
|
||||
@@ -8,3 +8,9 @@ package kotlin.internal
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
internal annotation class OnlyInputTypes
|
||||
|
||||
/**
|
||||
* Specifies that this function should not be called directly without inlining
|
||||
*/
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
internal annotation class InlineOnly
|
||||
Reference in New Issue
Block a user