# Sure() for generic arrays and collections

**URL:** <https://discuss.kotlinlang.org/t/sure-for-generic-arrays-and-collections/1251>\
**Category:** Uncategorized\
**Created:** [March 16, 2012, 8:39pm UTC](https://discuss.kotlinlang.org/t/sure-for-generic-arrays-and-collections/1251 "2012-03-16T20:39:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedos.serg](https://avatars.discourse-cdn.com/v4/letter/f/f1d935/32.png) [@fedos.serg](https://discuss.kotlinlang.org/u/fedos.serg)\
**Post date:** [March 16, 2012, 8:39pm UTC](https://discuss.kotlinlang.org/t/sure-for-generic-arrays-and-collections/1251/1 "2012-03-16T20:39:55Z")

</div>

Hello, is there any way in Kotlin to make this code work:

``

```kotlin
val test : Array<String> = “a,b,c”.split(“,”).sure()
```

  
without performance overhead?  
Now it requires Array\<String?\> as return value.

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [March 16, 2012, 8:53pm UTC](https://discuss.kotlinlang.org/t/sure-for-generic-arrays-and-collections/1251/2 "2012-03-16T20:53:27Z")

</div>

This problem is going to be fixed.

Currently, you can say “as Array\<String\>” at the end of the line.

---

<div class="post-metadata">

**Author:** ![fedos.serg](https://avatars.discourse-cdn.com/v4/letter/f/f1d935/32.png) [@fedos.serg](https://discuss.kotlinlang.org/u/fedos.serg)\
**Post date:** [March 17, 2012, 7:19am UTC](https://discuss.kotlinlang.org/t/sure-for-generic-arrays-and-collections/1251/3 "2012-03-17T07:19:58Z")

</div>

Thanks! Is there a tracker issue for that? Can you provide one?

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [March 17, 2012, 8:04am UTC](https://discuss.kotlinlang.org/t/sure-for-generic-arrays-and-collections/1251/4 "2012-03-17T08:04:02Z")

</div>

[http://youtrack.jetbrains.com/issue/KT-1278](http://youtrack.jetbrains.com/issue/KT-1278) is close to what you request. You can create a more presice issue or comment on this one.
