Xcode 10 Generics typealias Segmentation Fault 11 while archiving

Xcode 10 Generics typealias Segmentation Fault 11 while archiving

Xcode 10

归档 时出现分段错误

注:

我的代码:

typealias ResponseBlock<T> = (_ sender: T) -> Void

我在整个项目中都在使用它,例如:

var callback: ResponseBlock<AnyObject>? 

在 Xcode 10 归档时出错:

  1. 同时生成 Objective-C header
  2. 打印时................................
  3. 同时打印类型 'ResponseBlock<[IndexPath]>'(声明于.....] RangeText="typealias ResponseBlock = (_ sender: T) -> V")
  4. 正在打印类型“(T)”时 错误:分段错误:11

用法:

var refreshCells: ResponseBlock<[IndexPath]>?
viewModel.refreshCells = {indexPathList in 
     self.collectionView.reloadItems(at:   indexPathList)
}

我注意到 XCODE 10 Archive 处于发布模式和构建模式,运行 处于调试模式。

所以我查看了ReleaseDebug模式配置的区别

调查结果:

解法:

它解决了我的问题,现在不再收到分段错误。

将构建系统设置为使用遗留构建系统对我有用:

文件 > 工作区设置