// !DIAGNOSTICS: -UNCHECKED_CAST fun Collection.toArray(): Array = this as Array fun Collection.toArray2(): Array = this as Array fun toArray3(x: Collection): Array = x as Array class Foo { operator fun plus(x: Foo): Array { return this + x } } fun use(arg: Array, s: Collection, x: Foo) { arr(*arg) arr(*s.toArray()) arr(*s.toArray2()) arr(*toArray3(s)) arr(*x + x) arr(*(x + x)) } fun arr(x: Array) {}