This question stemmed from this StackOverflow post, in which it was called into question whether
Dictionary.Keys.contains(_:) has linear or constant time complexity.
I saw this Swift evolution proposal, Provide Custom Collections for Dictionary Keys and Values, which was implemented for Swift 4, and specifically calls out this issue as something it aims to improve.
Yet, when I look at the implementation of Dictionary.Keys, I don't see anything that would suggest that it has hash-based,
O(1) behavior for
.contains(_:) calls. I was expecting to find an overload of
contains(_:) that forwards to
self._variant, but that's not the case.
So what's going on here?