How are extension functions handled when two of them are valid?
As an example, I'm thinking of adding
Any?.filter
,
Any?.map
etc extension functions, to help with null handling.
How would the compiler react if it is used in a file in which
List.filter
(from the standard lib) is called? More precisely, if I write the following, which extension function would be called (assuming both are imported):
val l = listOf (...)
l.filter { it... }
In that case they are both valid choices by the compiler, since
List
is also a
Any?
. So, which one is called?