i´m trying Arrow Optics, and i have a nullable fie...
# arrow
c
i´m trying Arrow Optics, and i have a nullable field, but I can´t modify it with a null value, I have to make the field
Option<S>
Since we are kotlin syntax friends, i wonder if isn´t possible to set/modify nullable types
s
Good morning @carbaj0, Could you share a snippet of your domain?
c
Copy code
@optics
data class Test(
    val other: Option<String> = None
) {
    companion object
}

@optics
data class Test2(
    val other: String? = null
) {
    companion object
}

fun main() {
    val test2 = Test2()
    Test2.other.modify(test2) { null } -> not compile

    val test = Test()
    Test.other.modify(test) { None }
}