You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unknown origin of public abstract operator fun invoke(): R defined in kotlin.Function0[FunctionInvokeDescriptor@17ba57f0] (class kotlin.reflect.jvm.internal.impl.builtins.functions.FunctionInvokeDescriptor)
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Unknown origin of public abstract operator fun invoke(): R defined in kotlin.Function0[FunctionInvokeDescriptor@17ba57f0] (class kotlin.reflect.jvm.internal.impl.builtins.functions.FunctionInvokeDescriptor)
at kotlin.reflect.jvm.internal.RuntimeTypeMapper.mapSignature(RuntimeTypeMapper.kt:226)
at kotlin.reflect.jvm.internal.KFunctionImpl.<init>(KFunctionImpl.kt:52)
at kotlin.reflect.jvm.internal.CreateKCallableVisitor.visitFunctionDescriptor(util.kt:314)
at kotlin.reflect.jvm.internal.CreateKCallableVisitor.visitFunctionDescriptor(util.kt:291)
at kotlin.reflect.jvm.internal.impl.descriptors.impl.FunctionDescriptorImpl.accept(FunctionDescriptorImpl.java:826)
at kotlin.reflect.jvm.internal.KDeclarationContainerImpl.getMembers(KDeclarationContainerImpl.kt:62)
at kotlin.reflect.jvm.internal.KClassImpl$Data$declaredNonStaticMembers$2.invoke(KClassImpl.kt:173)
at kotlin.reflect.jvm.internal.KClassImpl$Data$declaredNonStaticMembers$2.invoke(KClassImpl.kt:173)
at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:70)
at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
at kotlin.reflect.jvm.internal.KClassImpl$Data.getDeclaredNonStaticMembers(KClassImpl.kt:173)
at kotlin.reflect.jvm.internal.KClassImpl$Data$allNonStaticMembers$2.invoke(KClassImpl.kt:182)
at kotlin.reflect.jvm.internal.KClassImpl$Data$allNonStaticMembers$2.invoke(KClassImpl.kt:182)
at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:70)
at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
at kotlin.reflect.jvm.internal.KClassImpl$Data.getAllNonStaticMembers(KClassImpl.kt:182)
at kotlin.reflect.jvm.internal.KClassImpl$Data$allMembers$2.invoke(KClassImpl.kt:188)
at kotlin.reflect.jvm.internal.KClassImpl$Data$allMembers$2.invoke(KClassImpl.kt:188)
at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:70)
at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
at kotlin.reflect.jvm.internal.KClassImpl$Data.getAllMembers(KClassImpl.kt:188)
at kotlin.reflect.jvm.internal.KClassImpl.getMembers(KClassImpl.kt:206)
at kotlin.reflect.full.KClasses.getFunctions(KClasses.kt:89)
at kotlin.reflect.jvm.ReflectJvmMapping.getKotlinFunction(ReflectJvmMapping.kt:144)
at io.mockk.core.ValueClassSupport.maybeUnboxValueForMethodReturn(ValueClassSupport.kt:26)
at io.mockk.proxy.jvm.advice.Interceptor.call(Interceptor.kt:22)
at io.mockk.proxy.jvm.advice.BaseAdvice.handle(BaseAdvice.kt:42)
at io.mockk.proxy.jvm.advice.jvm.JvmMockKProxyInterceptor.interceptNoSuper(JvmMockKProxyInterceptor.java:44)
at com.example.ValueClassInterface$Subclass0.invoke(Unknown Source)
at com.example.ValueClassInterface$Subclass0.invoke(Unknown Source)
at com.example.ValueClassTest$test$1.invoke-oVKG3qc(ValueClassTest.kt:37)
at com.example.ValueClassTest$test$1.invoke(ValueClassTest.kt:37)
at io.mockk.impl.eval.RecordedBlockEvaluator$record$block$1.invoke(RecordedBlockEvaluator.kt:24)
at io.mockk.impl.eval.RecordedBlockEvaluator$enhanceWithRethrow$1.invoke(RecordedBlockEvaluator.kt:76)
at io.mockk.impl.recording.JvmAutoHinter.autoHint(JvmAutoHinter.kt:23)
at io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:39)
at io.mockk.impl.eval.EveryBlockEvaluator.every(EveryBlockEvaluator.kt:30)
at io.mockk.MockKDsl.internalEvery(API.kt:94)
at io.mockk.MockKKt.every(MockK.kt:143)
at com.example.ValueClassTest.test(ValueClassTest.kt:37)
Context
MockK version: 1.3.10
OS: macOS Sonoma 14.4.1
Kotlin version: 1.9.23
JDK version: OpenJDK 21.0.2
JUnit version: 5.10.2
Type of test: unit test
The text was updated successfully, but these errors were encountered:
uwared
changed the title
Mocking doesn't work for a fucntional interface returing a value class
Mocking doesn't work for a functional interface returning a value class
Apr 22, 2024
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
The test below, which mocks a functional interface returning a value class, passes:
Minimal reproducible code
Current Behavior
The test is failing with an exception:
Stacktrace
Context
The text was updated successfully, but these errors were encountered: