Bad diagnostics and code completion, caused by Swift bug?

This bug (SR-9396) is still in Xcode 10.2.1.

Here's another perhaps simpler way to demonstrate it:

extension Array where Element == Int {
    // This foo() method will (unexpectedly) _always_ be
    // visible in code completion of any Array value,
    // regardless of what type Element is.
    func foo() { }
}

func test() {
    
    let nonIntArray = ["hello", "world"]
    
    // NOTE 1: foo() is in list of completions for `nonIntArray.`.
    
    // NOTE 2: This nonsensical error message:
    nonIntArray.foo() // ERROR: [String]' is not convertible to 'Array<Int>'
}
test()

And perhaps even simpler, this (what I guess is a) manifestation of the same bug:

let floatRange = Float(0) ..< Float(1)
floatRange.cou // ERROR: Value of type 'Range<Float>' has no member 'cou'; did you mean 'count'?

even though Range<Float> has no count.
(You'd get an error if you followed the error message's unhelpful "did you mean count?").
(I'd expect count to not even show up in the list of code completions for floatRange.)