swiftlang / swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Apache License 2.0
3.18k stars 403 forks source link

Fix up a mismatch between effect specifier lookahead and parsing #2660

Closed bnbarham closed 3 months ago

bnbarham commented 3 months ago

Lookahead was not consuming typed throw's error argument during lookahead for closures. atFunctionTypeArrow did mostly handle it, but only consumed a single token and thus wouldn't match throws(any Error). Handle this in consumeEffectsSpecifiers and then use this for both.

Fixes #2648. Resolves rdar://127750606.

bnbarham commented 3 months ago

@swift-ci please test