Skip to content

Commit

Permalink
Updates swift_quiz.md Q7 (#90)
Browse files Browse the repository at this point in the history
* Updates swift_quiz.md Q7

Code in Q7 or an answer was not correct, so here are possible options.

* Updates swift_quiz.md

Correcting Q11. I believe type of the function can be confirmed with assigning add() function to a constant and then check it's type with typeoff.
  • Loading branch information
igielskv authored Jul 6, 2020
1 parent 00ba7b3 commit a82e841
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions swift/swift_quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ typealias Thing = [String, Any]
var stuff: Thing
print(type(of: stuff))
```
- Dictionary<String, Any> <<<<---Correct
- Dictionary<String, Any> (To print this than code in question has to be ```typealias Thing = [String: Any]```)
- Dictionary
- ERROR
- ERROR <<<<---Correct (If code in question is really like that.)
- Thing

#### Q8. What is the value of y?
Expand Down Expand Up @@ -103,8 +103,8 @@ let y = x ?? 5
```swift
func add(a: Int, b: Int) -> Int { return a+b }
```
- Int <<<<---Correct
- (Int, Int) -> Int
- Int
- (Int, Int) -> Int <<<<---Correct
- Int<Optional>
- Functions don't have types.

Expand Down

0 comments on commit a82e841

Please sign in to comment.