Strange bug with optics ksp plugin. If this is th...
# arrow
d
Strange bug with optics ksp plugin. If this is the only class in a package, the optics fail to generate. Note the
breaks
field uses inferred type.
Copy code
@optics
data class Demo(val intValue: Int) {
    companion object {
        val breaks = Demo.intValue // If defined as `val breaks:Lens<Demo, Int>`, it works.
    }
}
Even more strangely, if I have any other optics in the same package that shares a named focus, it fixes all of them.
Copy code
@optics
data class Fixes(val intValue: String) { companion object }
I should mention, the failure is silent. Other packages are unaffected, but the optics just don't generate for the Demo class.
a
that is very strange. Our tests use mostly one class in the package, so that's extra odd. Do you happen to have a project I could use for reproducing the bug?
d
let me see if I can create one... The source tree I'm working on now is in various states of incomplete.
a
d
Nice!