Avatar
それが↓のコンパイルエラーの話なんじゃないかな? func nthOfEach( _ n: Int, from heterogeneousCollections: [any Collection] ) -> Any { return heterogeneousCollections.map { collection in // collection is `any Collection` let nthIndex = collection.startIndex.advanced(by: n) // error: inferred static type of nthIndex is something like `any Collection.Index`, // so compiler can’t guarantee it indexes `collection` … correct? return collection[nthIndex] } }