Kev
07/13/2024, 9:25 AMInconsistent number of parameters in the descriptor and Java reflection object: 2 != 1 . I’ll place replication code within the thread of this message.Kev
07/13/2024, 9:26 AMdata object MyError1
data object MyError2
@JvmInline
value class TestId(val id: String)
class Foo {
  context(Raise<MyError2>)
  fun foo(): TestId {
    return TestId("hello")
  }
}
class Service(private val foo: Foo) {
  context(Raise<MyError1>)
  fun test(): TestId {
   return withError({ MyError1 }) {
      foo.foo()
    }
  }
}
class TestFunSpec : FunSpec(
  {
    test("test") {
      val foo = mockk<Foo>()
      val service = Service(foo)
      every {
        with(any<Raise<Any>>()) {
          foo.foo()
        }
      } answers { TestId("hello") }
      either {
        service.test()
      }.shouldBeRight()
    }
  },
)Kev
07/13/2024, 9:27 AMTestId to a simple String, everything works fine.CLOVIS
07/15/2024, 9:55 AM