sindrenm
07/13/2023, 11:18 AM<*>
gets replaced with <* kotlin.Any?>
. See example in thread.@optics
data class GenericType<A>(
val field1: A
) { companion object }
@optics
data class IsoData(val genericType: GenericType<*>) {
companion object
}
generates:
public inline val IsoData.Companion.iso: Iso<IsoData, GenericType<* kotlin.Any?>> inline get() = Iso(
get = { isoData: IsoData -> isoData.genericType },
reverseGet = { IsoData(it) }
)
public inline val IsoData.Companion.genericType: Lens<IsoData, GenericType<* kotlin.Any?>> inline get() = Lens(
get = { isoData: IsoData -> isoData.`genericType` },
set = { isoData: IsoData, value: GenericType<* kotlin.Any?> -> isoData.copy(`genericType` = value) }
)
public inline val <S> Iso<S, IsoData>.genericType: Lens<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
public inline val <S> Lens<S, IsoData>.genericType: Lens<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
public inline val <S> Optional<S, IsoData>.genericType: Optional<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
public inline val <S> Prism<S, IsoData>.genericType: Optional<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
public inline val <S> Getter<S, IsoData>.genericType: Getter<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
public inline val <S> Setter<S, IsoData>.genericType: Setter<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
public inline val <S> Traversal<S, IsoData>.genericType: Traversal<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
public inline val <S> Fold<S, IsoData>.genericType: Fold<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
public inline val <S> Every<S, IsoData>.genericType: Every<S, GenericType<* kotlin.Any?>> inline get() = this + IsoData.genericType
GenericType<* kotlin.Any?>
is the culprit and should just be GenericType<*>
.GenericType<kotlin.Any?>
, actually, which of course also compiles.Alejandro Serrano Mena
07/13/2023, 1:42 PMsindrenm
07/13/2023, 2:07 PM