# Type narrowing

**URL:** <https://forums.swift.org/t/type-narrowing/75266>\
**Category:** Compiler\
**Tags:** type-inference\
**Created:** [October 10, 2024, 3:35am UTC](https://forums.swift.org/t/type-narrowing/75266 "2024-10-10T03:35:46Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![AlexanderM](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/alexanderm/32/9781_2.png) [@AlexanderM](https://forums.swift.org/u/AlexanderM)\
**Post date:** [October 10, 2024, 5:37am UTC](https://forums.swift.org/t/type-narrowing/75266/4 "2024-10-10T05:37:22Z")

</div>

@1-877-547-7272 You just jogged my memory on this...

Type narrowing doesn't work well for mutable stored properties and computed properties. There's no guarantee that it being non-`nil` at the time of first check will mean it's still `nil` when called the second time.

See [Yelling at a rocket after launch: checked optionals - #9 by AlexanderM](https://forums.swift.org/t/yelling-at-a-rocket-after-launch-checked-optionals/65719/9)

---

_[View the full topic](https://forums.swift.org/t/type-narrowing/75266)._
