Skip to content

Commit

Permalink
value class check - catch KotlinReflectionInternalError
Browse files Browse the repository at this point in the history
might fix mockk#868, caused by mockk#913?
  • Loading branch information
aSemy committed Sep 16, 2022
1 parent 1f2d038 commit ba52df1
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -6,6 +6,7 @@ import kotlin.reflect.full.declaredMemberProperties
import kotlin.reflect.full.primaryConstructor
import kotlin.reflect.jvm.isAccessible
import kotlin.reflect.jvm.javaField
import kotlin.reflect.jvm.internal.KotlinReflectionInternalError


actual object ValueClassSupport {
Expand Down Expand Up @@ -61,6 +62,8 @@ actual object ValueClassSupport {
private val <T : Any> KClass<T>.isValue_safe: Boolean
get() = try {
this.isValue
} catch (_: KotlinReflectionInternalError) {
false
} catch (_: UnsupportedOperationException) {
false
}
Expand Down

0 comments on commit ba52df1

Please sign in to comment.