<Why List.indexOf accepts nullable types?> Why doe...
# forum
r
Why List.indexOf accepts nullable types? Why does a List of non-nullable elements accepts a nullable object in indexOf? It seems to aways return -1, which makes sense, since null is not in the list. But if I try to pass null (instead of a variable that points to null) the code does not compiles. The documentation also seems to imply that this function should not accept a nullable value: docs. Maybe it has...