You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: unexpected code '[X]' in parameter clause
test { ([X]) in }
^~~
Old parser:
warning: unnamed parameters must be written with the empty name '_' [parameter_unnamed_warn]
test { ([X]) in }
^
_:
This is a special case. More generally, the old parser is capable of diagnosing this kind of closure parameter production gracefully when all of the following are true:
ahoppen
changed the title
Bad diagnostic for explicit parameter type with missing parameter name in closure parameter
New parser does not accept closure parameter only consisting of a type
Nov 9, 2023
ahoppen
changed the title
New parser does not accept closure parameter only consisting of a type
Improve diagnostic for unnamed closure parameter
Nov 28, 2023
To clarify: The C++ parser used to emit a warning for this and is changed in apple/swift#70065 to instead emit an error. The new parser should also emit an error but one that is nicer than the currently emitted unexpected code '[X]' in parameter clause
Issue Kind
Bad Diagnostic Produced
Source Code
Description
New parser:
Old parser:
This is a special case. More generally, the old parser is capable of diagnosing this kind of closure parameter production gracefully when all of the following are true:
Parser::canParseType()
, and said type is followed by,
,)
, or=
(link)Related to #2331.
The text was updated successfully, but these errors were encountered: