[SR-14824] Improve diagnostic for multi-statement closures instead of saying "too complex closure return type" #57172
Labels
compiler
The Swift compiler in itself
diagnostics QoI
Diagnostics Quality of Implementation
good first issue
Good for newcomers
improvement
type checker
Additional Detail from JIRA
md5: 36dfe752f68258a70ceeb284792464d3
Issue Description:
See https://forums.swift.org/t/too-complex-closure-return-type/49897 – it's not clear why a closure is "too complex" because from a user perspective, it looks quite simple.
In case there are multiple statements, we can provide a more specialized diagnostic saying that the compiler doesn't support inferring types of closures with multiple statements.
The text was updated successfully, but these errors were encountered: