Having fun with optics: ```@optics sealed interfa...
# arrow
r
Having fun with optics:
Copy code
@optics
sealed interface DetectionState {
    data object KnowNothing: DetectionState
    data class KnowCecVersion(val cecVersion: CECVersion): DetectionState
    // here, we're waiting for external input.
    data class KnowDeviceId(val cecVersion: CECVersion, val deviceId: TVDeviceID?): DetectionState
    data class KnowDeviceControl(
        val cecVersion: CECVersion,
        val brandId: Long,
        val configuration: TVControlConfigurationDetection,
    ): DetectionState {
        companion object
    }
    data class Failed(val state: DetectionState, val failure: FailedDetection): DetectionState
    companion object
}
Gives me
Copy code
Conflicting declarations: public val <S> Iso<S, DetectionState> /* = PIso<S, S, DetectionState, DetectionState> */.failed: Prism<S, DetectionState.Failed> /* = PPrism<S, S, DetectionState.Failed, DetectionState.Failed> */, public val <S> Lens<S, DetectionState> /* = PLens<S, S, DetectionState, DetectionState> */.failed: Optional<S, DetectionState.Failed> /* = POptional<S, S, DetectionState.Failed, DetectionState.Failed> */, public val <S> Optional<S, DetectionState> /* = POptional<S, S, DetectionState, DetectionState> */.failed: Optional<S, DetectionState.Failed> /* = POptional<S, S, DetectionState.Failed, DetectionState.Failed> */, public val <S> Prism<S, DetectionState> /* = PPrism<S, S, DetectionState, DetectionState> */.failed: Prism<S, DetectionState.Failed> /* = PPrism<S, S, DetectionState.Failed, DetectionState.Failed> */, public val <S> [Error type: Unresolved type for arrow.optics.Setter<S, me.getreach.silverlink.control.DetectionState>]<S, DetectionState>.failed: [Error type: Unresolved type for arrow.optics.Setter<S, me.getreach.silverlink.control.DetectionState.Failed>]<S, DetectionState.Failed>, public val <S> Traversal<S, DetectionState> /* = PTraversal<S, S, DetectionState, DetectionState> */.failed: Traversal<S, DetectionState.Failed> /* = PTraversal<S, S, DetectionState.Failed, DetectionState.Failed> */, public val <S> [Error type: Unresolved type for arrow.optics.Fold<S, me.getreach.silverlink.control.DetectionState>]<S, DetectionState>.failed: [Error type: Unresolved type for arrow.optics.Fold<S, me.getreach.silverlink.control.DetectionState.Failed>]<S, DetectionState.Failed>, public val <S> [Error type: Type for error type constructor (Every)]<S, DetectionState>.failed: [Error type: Type for error type constructor (Every)]<S, DetectionState.Failed>
... and a bunch more
New version provides.