Iso generation is supported for data classes with up to 22 constructor parameters

164 views Asked by At

@optics data class test( 1,2,...23) { companion object }

[ERROR] Iso generation is supported for data classes with up to 22 constructor parameters.

1

There are 1 answers

1
nomisRev On

bodduluri,

In Arrow-kt we only support automatic generation for Iso up to 22 parameters. The reason for this is that Arrow only has Tuple3 -> Tuple22 defined. Pair and Triple from Kotlin Std are also used.

The example you shared data class test( 1,2,...23) has 23 parameters, so Arrow cannot generate the desired Iso.

You can still automatically genrate Lens and Optional for your data class by specifying @optics(arrow.optics.OpticsTarget.Lens, arrow.optics.OpticsTarget.Optional).