rojiani / bnr-swift

Examples & Solutions to the Challenges for the BNR Swift Book, 1st Edition
1 stars 7 forks source link

Parenthesis around element needed (single argument function types require parenthesis) #1

Open kaitlynhwang opened 7 years ago

kaitlynhwang commented 7 years ago

Chapter 22

/ Bronze Challenge / func filter(f: Element -> Bool) -> Stack { var filteredItems = [Element]() for item in items { if (f(item)) { filteredItems.append(item) } } return Stack(items: filteredItems) }

to func filter(f: (Element) -> Bool) -> Stack

rojiani commented 7 years ago

From the README -

Ch. 27 uses Swift 3, all other chapters are in Swift 2.2