# Double-optional nil comparisons seem non-intuitive

**URL:** <https://forums.swift.org/t/double-optional-nil-comparisons-seem-non-intuitive/25620>\
**Category:** Using Swift\
**Tags:** optional, equality\
**Created:** [June 11, 2019, 6:52pm UTC](https://forums.swift.org/t/double-optional-nil-comparisons-seem-non-intuitive/25620 "2019-06-11T18:52:34Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![kansaichris](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kansaichris/32/2703_2.png) [@kansaichris](https://forums.swift.org/u/kansaichris)\
**Post date:** [June 12, 2019, 9:25am UTC](https://forums.swift.org/t/double-optional-nil-comparisons-seem-non-intuitive/25620/8 "2019-06-12T09:25:33Z")

</div>

Speaking of nested optionals, here's some more grist to the mill…

> [@Challenge: Finding base type of nested optionals](https://forums.swift.org/t/challenge-finding-base-type-of-nested-optionals/25096):
>
> Following on from my [last challenge](https://forums.swift.org/t/challenge-flattening-nested-optionals/24083), this one is somewhat trickier: Given an arbitrarily-nested Optional, the goal is to programmatically identify the inner-most Wrapped type (aka. its base type). Note that the optional may be nil at any depth, and it may be wrapped in further layers of Any and/or Optional. For example, an Int??? has a base type of Int, regardless of its value. Moreover, casting an Optional to Any, and/or wrapping it in additional layers of Optional, does not change its base t…

---

_[View the full topic](https://forums.swift.org/t/double-optional-nil-comparisons-seem-non-intuitive/25620)._
