当元素是一种元组时,有没有办法扩展数组? public extension Array where Element: (timeZoneName: String, formattedName: String){} This declaration returns 4 errors: Statement cannot begin with a closure expression Braced bloc
public extension Array where Element: (timeZoneName: String, formattedName: String){ }
This declaration returns 4 errors:
- Statement cannot begin with a closure expression
- Braced block statements is an unused closure
- Expected ‘{‘ in extension
- Expected identifier for type name
我不知道所显示的错误是否准确.
有任何想法吗?
extension Sequence where Iterator.Element == Tuple2 { func foo() {} }