tim
10/21/2020, 12:57 PMDuplicate JVM class name
error after moving to arrow 0.11.0 and Kotlin 1.4.10 when using optics. As far as I can tell this is similar to the issue @Joram Visser raised here except in my case I'm using gradle not maven.
I'm struggling to debug this, because optics are compiling correctly elsewhere in the same project, and it just seems to be one data class that is now causing this error. I tried creating a new repo and reproducing but it compiles and run fine.
Any suggestions on how to approach debugging this?tim
10/21/2020, 1:09 PMpackage io.glimpseprotocol.vault.domain.state
import arrow.optics.optics
import io.glimpseprotocol.core.domain.vault.Mnemonic
import io.glimpseprotocol.core.infrastructure.IDocument
import io.glimpseprotocol.core.valueobject.Id
import io.glimpseprotocol.vault.domain.module.ModuleMeta
import io.glimpseprotocol.vault.domain.module.dataingest.DataIngestModule
import io.glimpseprotocol.vault.domain.module.export.ExportModule
import io.glimpseprotocol.vault.domain.module.ping.PingModule
import io.glimpseprotocol.vault.domain.module.prebid.PrebidModule
import java.time.Instant
typealias NextVaultState = State
@optics
data class State(
override val _id: Id<State> = Id(),
override val _created: Instant = Instant.now(),
override val _updated: Instant = Instant.now(),
override val _schema: Int = 1,
val mnemonic: Mnemonic = Mnemonic(),
val ping: ModuleMeta = PingModule.DefaultMeta,
val data: ModuleMeta = DataIngestModule.DefaultMeta,
val export: ModuleMeta = ExportModule.DefaultMeta,
val identity: IdentityState = IdentityState(),
val tether: List<TetherState> = emptyList(),
val prebid: ModuleMeta = PrebidModule.DefaultMeta,
val frequencyCapping: FrequencyCappingState = FrequencyCappingState()
) : IDocument<State> {
override fun touch(): State =
copy(_updated = Instant.now())
companion object
}
tim
10/21/2020, 2:55 PM@file:JvmName("SomethingUnique")
as per https://stackoverflow.com/questions/57762986/how-to-configure-build-gradle-kts-to-fix-error-duplicate-jvm-class-name-generat
... maybe this is a kotlin issue?Joram Visser
10/23/2020, 7:12 PM@file:JvmName("SomethingUnique")
does work for my case as well. Thanks! 😄 That is already cleaner than copy pasting the generated code (which was my work around up until now).raulraja
10/26/2020, 10:36 AMtim
10/27/2020, 3:49 PM