I have a base enum like this
enum MyEnum<T> {
val initialValue: T
val minValue: T
val maxValue: T
}
And I have a couple of methods like:
protected fun setEngineValue(myEnum: MyEnum<Float>, value: Float): Boolean {}
protected fun setEngineValue(myEnum: MyEnum<Int>, value: Int): Boolean {}
I want to merge it into one function where the type of value is inferred from myEnum. I have done this in other languages like Typescript but I can not find a way to do it in Kotlin.
Something like:
protected fun setEngineValue(myEnum: MyEnum<*>, value: typeOf *): Boolean {
}