Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Swift
/
Protocol constraints and existentials
Who determines the `Item` in a conformance to `protocol Catalog<Item>`?
from Protocol constraints and existentials
Swift 6.3.3
intermediate
1 min
Who determines the `Item` in a conformance to `protocol Catalog<Item>`?
The conforming type, through the witnesses that satisfy the protocol.
Every method caller chooses a new Item.
The first existential value stored at runtime chooses it globally.
The protocol extension always fixes it as Any.
Check
Ask AI about this kata
Report an error
next kata
Which form fits a returned value whose implementation chooses one hidden concrete type?
Quiz
A new version is available
Reload