Xcode挂起“编译Swift源文件” [英] Xcode hangs on "Compiling Swift source files"

查看:110
本文介绍了Xcode挂起“编译Swift源文件”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Xcode 7.3.1。在构建基于Swift的项目时,它依赖于编译Swift源文件。我已经尝试了删除 DerivedData ,清理,运行,重新启动Xcode,重新启动OS X的各种组合,似乎没有工作。有什么想法?

I'm running Xcode 7.3.1. When building my Swift based project, it hangs on "Compiling Swift source files". I've tried various combination of deleting DerivedData, clean, run, restarting Xcode, restarting OS X, none seem to work. Any ideas?

推荐答案

感谢所有评论员的建议。我把它缩小到 map 的闭包,引用了我删除的属性。示例:

Thanks for all commentors' suggestions. I narrowed it down to a map's closure referencing a property that I had removed. Example:

var people: [Person] = ...
let foo = people.map { "\($0.name), \($0.age)" }

其中类似于:

protocol Person {
    var name: String { get }
    var age: Int { get }
}

一切正常。然后我删除 age ,同时保持闭包不变。这导致Xcode变得无可救药地混淆。可能与Swift的类型推断有关。

This all works fine. Then I removed age while keeping the closure unchanged. This caused Xcode to become hopelessly confused. Probably related to the Swift's type inference.

这篇关于Xcode挂起“编译Swift源文件”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆