ilya.gorbunov
04/24/2017, 12:54 PMpublic operator fun <T> Iterable<T>.minus(element: T): List<T>
be defined with element as nullable?
public operator fun <T> Iterable<T>.minus(element: T?): List<T>
I.e. if you call listOf<String>(...) - null as String?
it would just return the same List<String>
and not List<String?>
as it currently does.
13 replies
This has to investigated, whether it's possible to add something like this: https://github.com/JetBrains/kotlin/blob/1.1.0/libraries/stdlib/src/kotlin/collections/MutableCollections.kt#L15
so that type of element to be removed could be any direct supertype of element type of the collection.