This example, copied from the guide into a Playground should compile:
import Foundation
public protocol Container {
associatedtype Item
}
extension Container {
func average() -> Double where Item == Int {
var sum = 0.0
for index in 0..<count {
sum += Double(self[index])
}
return sum / Double(count)
}
}
It does not. Xcode shows an error:
'where' clause cannot be attached to a non-generic declaration
What is necessary to run the above code successfully?