I'm kinda stuck when the compiler said that this f...
# getting-started
m
I'm kinda stuck when the compiler said that this function:
fun a(items: Array<Item>)
cannot be invoked like this:
Copy code
fun b(vararg items: Item) {
    a(items)
}
because...
items
is
Array<out Item>
, not
Array<Item>
. This also means that I can't write to this array. Why? This may lead to situations when some code cannot be converted from Java.
m
You can
a(items as Array<Item>)
m
Yes, but this is quite confusing that
Copy code
Array<out Item>
is not accepted as
Copy code
Array<Item>
😕