how should I make a delegate with a default value ...
# announcements
a
how should I make a delegate with a default value from a config if the current val DNE or is the wrong type? From what I see, I would need to have both
DelegateClass<A>
and
inline operator fun <reified T> getValue
which would look really messy since we are assuming
A
and
T
are the same. I would need to do this, because I need to input the default value into the class, but classes can't be reified.
I'll use
KClass::isInstance()
think this is the best solution?
k
WHat does "DNE" mean? Can you give an example of how you want this to work?
h
What operator is getValue?
k
a
@karelpeeters Does Not Exist
bump