Kev
01/10/2024, 12:46 PMcontext(Raise<Error>, Logger)
fun myFunction(value: Int): String {
debug("this is a debug message")
ensure(value > 1) {
Error()
}
return "Yay!"
}
Then trying to run the function with applicable scopes fails because it can’t find the required receivers:
either {
with(LoggerFactory.getLogger(this::class.java)) {
// No required context receiver found: Cxt { context(arrow.core.raise.Raise<kotlin.Error>, org.slf4j.Logger)
// public fun myFunction(value: <http://kotlin.Int|kotlin.Int>): kotlin.String
myFunction(3)
}
}
It moans that the correct receivers aren’t present. It also highlights that the with block for the logger is unused and not required 👀Kev
01/10/2024, 12:48 PM