carbaj0
10/06/2021, 9:29 AMdata class
with parentheses?Grégory Lureau
10/06/2021, 9:37 AMStringAction("...") {}Means that the last parameter of the constructor is a lambda, that's not the case here, as you have 2 method calls : constructor followed by invoke on the Action instance.
Jacob
10/06/2021, 12:44 PMCasey Brooks
10/06/2021, 2:46 PMnewString
data class StringAction(val value: String) : Action {
companion object {
operator fun invoke(value: String, f: ()->String): String {
return StringAction(value).invoke(f)
}
}
}
Grégory Lureau
10/06/2021, 4:51 PM