Need help with my example sealed class
sealed class Color
object Red: Color()
object Green: Color()
object Blue: Color()
class NewColor(
var flag: Boolean = false,
var id: String = "" or Int = -1 <-----I want id to be either an Int or String
): Color()
I'd like to be able to assign an Int or String to id. Do I need another sealed class?
So I can use it like
...
var result = NewColor(
id = "Purple" or id = R.color.purple
)