gpt4 book ai didi

ios - 编译器无法对表达式Swift 5进行类型检查?

转载 作者:行者123 更新时间:2023-12-02 11:10:06 27 4
gpt4 key购买 nike

尝试编译我的代码时遇到麻烦,因为此错误不断出现:

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions.



这是代码中出现错误的部分:
enter image description here

关于如何获取代码进行编译和清除此错误的任何想法?

最佳答案

解决方案是将您的表达式分成许多表达式,例如尝试替换:

return Council(status: status ?? self.status,
council : council ?? self.council,
year: year ?? self.year,
councilRating: councilRating ?? self.councilRating,
annualChange: annualChange ?? self.annualChange,
councilTax: councilTax ?? self.councilTax)

带有:
let s = status ?? self.status
let c = council ?? self.council
let y = year ?? self.year
let cr = councilRating ?? self.councilRating
let ac = annualChange ?? self.annualChange
let ct = councilTax ?? self.councilTax


return Council(status: s,
council : c,
year: y,
councilRating: cr,
annualChange: ac,
councilTax: ct)

关于ios - 编译器无法对表达式Swift 5进行类型检查?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59801282/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com