Well, some people seem to think it’s a good idea to work with constructs like a dictionary of AnyKeyPath
s to optional properties. I don’t personally vouch for that design, but it apparently exists.
Mostly I just wanted to see if I could, and it wasn’t immediately obvious how to test whether an Any
is actually an Optional
for recursive unwrapping.
What is more difficult, is to programmatically identify the bottom-most Wrapped
type in an arbitrary stack of Optional
s that includes Any?
, especially if some layer other than the innermost is actually .none
.