arrow ensure doesn't make value non nullable after check
have a question about ensure function, somehow it doesn't make null safe after check in either block.
What I am doing wrong, or is there a better way to ensure that value is not null except of using !!
here is my code
suspend fun checkCanConnectDirectChat(
senderId: Int?,
receiverId: Int?,
chatRoomId: Int?
) = either {
ensure(chatRoomId != null && receiverId != null) {
BadRequestExceptionResponse(message = ErrorConstants.INVALID_PAYLOAD)
}
val isSenderInChat...