The book says that "functions and closures are reference types".那么,如何确定引用是否相等? ==和===不起作用。
func a() { }
let å = a
let b = å === å // Could not find an overload for === that accepts the supplied arguments
最佳答案
克里斯·拉特纳(Chris Lattner)在开发人员论坛上写道:
https://devforums.apple.com/message/1035180#1035180
这意味着您甚至不应该尝试比较闭包是否相等,因为优化可能会影响结果。