Would anyone be willing to explain to me what is h...
# getting-started
g
Would anyone be willing to explain to me what is happening in this image? I am having trouble understanding the type signature (never seen one like this before) and why it won't accept the value as a valid type
Copy code
and((MutableCollection<out Condition!>..Collection<Condition!>?))
I think this means "A type with a lower-bounds of
MutableCollection<out Condition!>
and an upper-bounds of `Collection<Condition!>?`"
But if that is true, then explicitly casting to either of those should have made it work, which it doesn't (as you see in the image) 🤔 😕
c
have you tried,
val x: MutableCollection<Condition>
?
p
Or
return add(*conds.toTypedArray())
g
casting to varargs and typed array does work, but just confused why trying to return a
Collection
or
MutableCollection
doesn't