This is a real example, I was looking to extend an array of a certain type in Swift. I searched Dash, online docs and the iBooks guide to no avail. I finally found this SO answer and tried a more refined search, yet still did not find anything.
Even going right the way down to the raw spec, there is no where clause:
extension type-identifier type-inheritance-clause {}
type-inheritance-clause -> : class-requirement
class-requirement -> class
Which I read as:
extension Array: Person {} // doesn't compile
but, this is valid (and what I needed):
extension Array where Element: Person {}
- where is the correct documentation?
- what should I have searched for?