我想知道为什么编译
extension Array where Element == Int {
func newTest() {
let array = [[1,2,3],[4,5,6],[7,8,9]]
let j = Array(array.joined())
let f = array.flatMap{$0}
}
}
但这不会编译
struct Test<T> {}
extension Array where Element == Test<Int> {
func newTestGeneric() {
let array = [[1,2,3],[4,5,6],[7,8,9]]
let j = Array(array.joined())
let f = array.flatMap{$0}
}
}
在此行
let j = Array(array.joined())
我得到一个错误:
Ambiguous reference to member 'joined()'