Missing 'in' in closure leads to unhelpful error #59928
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
closures
Feature: closures
compiler
The Swift compiler itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
good first issue
Good for newcomers
missing warning
Bug: Missing warning
parser
Area → compiler: The legacy C++ parser
swift 5.9
Compiling the following code
leads to the following diagnostics:
(thanks, swift.godbolt.org)
This is not a great error message for several reasons:
With parameters, we get different poor errors:
x -> Int
,(x) -> Int
(x: Int) -> Int
x, y -> Int
(x, y) -> Int
(x: Int, y: Int) -> Int
The text was updated successfully, but these errors were encountered: