I understand that Swift's type inference cannot handle expressions that are too complex. However, I don't think consider this to be one of those complex expressions:
func fn<T>(_ a: T, _ b: (T) -> T) {}
fn(0) {(result) in
result + result + (result + 1) + (result + 1)
}
This churns for over 16 seconds before bailing with a message about the expression being too complex. Is this a bug? Again, I understand the complexity issues, but this is something I know other type-inferred languages (e.g. Crystal) handle just fine...
FWIW adding a type annotation to result
(e.g. (result: Int) in ...
) makes it virtually instant.