any thoughts on this? did I just mess the syntax u...
# announcements
m
any thoughts on this? did I just mess the syntax up?
a
So your problem right now is the type arguments when creating a
PrimeCacheKey
?
m
yes
I want the upper bounds to be codified when you create the data loader, but every addition to the loader (using the sealed class) enforce the type upper bound, at compile time, without having to specify it explictly for every call
a
that sounds like a job for variance:
Copy code
sealed class DataLoaderMsg <out K, out V>
data class  PrimeCacheKey<K, V>(val key: K, val value: V): DataLoaderMsg<K, V>()
m
ok great, that works, thank you