“致命错误:无法调用不可用的功能”

时间:2022-05-04 21:18:09

So I just downloaded Xcode 7 GM, and out pops this error:

所以我刚下载了Xcode 7 GM,然后弹出这个错误:

fatal error: unavailable function can't be called: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-700.0.59/src/swift/stdlib/public/core/RangeReplaceableCollectionType.swift, line 329

Any ideas on how to resolve this?

关于如何解决这个问题的任何想法?

1 个解决方案

#1


0  

Turns out, I had a protocol with the function extend as a requirement.

事实证明,我有一个带有函数extend的协议作为要求。

public protocol Appendable: Initiable, SequenceType
{
    mutating func insert(_: Generator.Element)
    mutating func append(_: Generator.Element)
    mutating func extend<S: SequenceType where S.Generator.Element == Generator.Element>(_: S)
}

Now extend has been renamed to appendContentsOf, however Xcode stayed shush when it came to my protocol requiring it (a bug). Whenever I called extend on conformant types (in my case Array, Dictionary and Set), instead of telling me that extend had been renamed, it just resolved the issue by using a function guaranteed by Appendable, also extend. And guess who provided the implementation.

现在extend已经被重命名为appendContentsOf,但是当我的协议需要它时,Xcode仍然保持嘘声(一个bug)。每当我调用符合类型的扩展(在我的情况下是数组,字典和集合),而不是告诉我扩展已被重命名,它只是通过使用Appendable保证的函数来解决问题,也扩展。并猜猜谁提供了实施。

That's right.

那就对了。

PS: I ran the migrator before doing all of this, and it should have resolved this issue, but eh.

PS:我在完成所有这些之前运行了迁移器,它应该已经解决了这个问题,但是呃。

#1


0  

Turns out, I had a protocol with the function extend as a requirement.

事实证明,我有一个带有函数extend的协议作为要求。

public protocol Appendable: Initiable, SequenceType
{
    mutating func insert(_: Generator.Element)
    mutating func append(_: Generator.Element)
    mutating func extend<S: SequenceType where S.Generator.Element == Generator.Element>(_: S)
}

Now extend has been renamed to appendContentsOf, however Xcode stayed shush when it came to my protocol requiring it (a bug). Whenever I called extend on conformant types (in my case Array, Dictionary and Set), instead of telling me that extend had been renamed, it just resolved the issue by using a function guaranteed by Appendable, also extend. And guess who provided the implementation.

现在extend已经被重命名为appendContentsOf,但是当我的协议需要它时,Xcode仍然保持嘘声(一个bug)。每当我调用符合类型的扩展(在我的情况下是数组,字典和集合),而不是告诉我扩展已被重命名,它只是通过使用Appendable保证的函数来解决问题,也扩展。并猜猜谁提供了实施。

That's right.

那就对了。

PS: I ran the migrator before doing all of this, and it should have resolved this issue, but eh.

PS:我在完成所有这些之前运行了迁移器,它应该已经解决了这个问题,但是呃。