Sure() for generic arrays and collections


#1

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

``

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


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

#2

This problem is going to be fixed.

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


#3

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


#4

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.