swiftlang/swift

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

Open

#55.028 aperta il 14 apr 2020

Vedi su GitHub
 (7 commenti) (1 reazione) (0 assegnatari)Swift (10.719 fork)batch import
bugcompilergood first issue

Metriche repository

Star
 (69.989 star)
Metriche merge PR
 (Merge medio 8g 17h) (510 PR mergiate in 30 g)

Descrizione

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 {} {}

Guida contributor