swiftlang/swift

[SR-12583] `foo() {} {}` parses but `foo {} {}` does not

Open

#55,028 opened on Apr 14, 2020

View on GitHub
 (7 comments) (1 reaction) (0 assignees)Swift (10,719 forks)batch import
bugcompilergood first issue

Repository metrics

Stars
 (69,989 stars)
PR merge metrics
 (Avg merge 8d 17h) (510 merged PRs in 30d)

Description

Previous ID SR-12583
Radar rdar://problem/62202372
Original Reporter @jckarter
Type Bug
Votes 1
Component/s Compiler
Labels Bug, StarterBug
Assignee None
Priority Medium

md5: f3208365889a29361424efaa2b6814cd

Issue Description:

If you have a function that takes a function, then returns a function that takes another function:

func foo(_: ()->()) -> (() -> ()) -> () { fatalError() }

Then you can call it like this:

foo() {} {}

but this doesn't parse:

foo {} {}

Contributor guide