sreich
08/12/2022, 5:09 PMcliOptions += CliOption()
clioptions is a java List
Assignment operators ambiguity. All these functions match.
public operator fun <T> Collection<CliOption!>.plus(element: CliOption!): List<CliOption!> defined in kotlin.collections
public inline operator fun <T> MutableCollection<in CliOption>.plusAssign(element: CliOption): Unit defined in kotlin.collectionsJoffrey
08/12/2022, 5:18 PMcliOptions.add(CliOption()) or cliOptions = cliOptions + CliOption() depending on the one you wantephemient
08/12/2022, 5:40 PMvar : MutableList is a poor design choice anywaysreich
08/12/2022, 5:47 PM= + ? this doesn't really answer why += doesn't work, and why i have to explicitly call assignPlus()sreich
08/12/2022, 5:47 PMephemient
08/12/2022, 5:49 PM.plusAssign and = .plus are the respective meanings of += with val cliOptions: MutableList and var cliOptions: List respectively. but if you have a var cliOptions: MutableList then += is ambiguous