Advanced
Swift
Q97 / 100
What is Swift's opaque type and its interaction with primary associated types?
Correct! Well done.
Incorrect.
The correct answer is B) some Collection<Int> constrains the opaque type's Element, enabling cleaner API than full generic constraints while hiding the concrete type
B
Correct Answer
some Collection<Int> constrains the opaque type's Element, enabling cleaner API than full generic constraints while hiding the concrete type
Explanation
func getNumbers() -> some Collection<Int> says "returns a specific Collection with Int elements" without revealing the concrete type (Array, Set, etc.).
Progress
97/100