ios - Swift:具有约束的关联类型的协议产生“非法指令”
问题描述
我有以下代码:
protocol Transformable {
associatedtype OutputType
func transform() -> OutputType
}
protocol AB {
associatedtype A: Transformable where A.OutputType == B
associatedtype B: Transformable where B.OutputType == A
}
我得到了错误:
由于信号而命令失败:非法指令:4
没有更多关于错误是什么的细节。
代码确实感觉有点奇怪,但问题是什么?
解决方案
推荐阅读
- sql - 如何在表格的字段中搜索具有字母 r 然后是 s 的元素,但按此顺序?
- sql - 如何分隔访问字段的行?
- javascript - 您可以通过 MUI DataCode 中的代码取消选中复选框吗?
- kubernetes - 如何知道在 helm 图表中暴露了哪些值/可以自定义哪些值?
- python-3.x - locust主节点支持的最大worker数?
- c# - 如何将数据元素从 HTML 传递到代码页 Razor 组件
- mouse - 为什么我的鼠标只能左右不工作而滚轮是当我移动鼠标时我的鼠标根本不移动
- php - Laravel Dump,Die dd() 未显示完整结果
- html - 如何在项目符号中添加框图标并在我的网站中添加编号?
- powershell - 在 Microsoft Edge 中使用资源管理器打开 - SharePoint 2013 又名本地