Moving toward deprecating force unwrap from Swift?

I'm closing this thread, to stop the ongoing discussion of a topic the core team's already ruled on, since newcomers to the thread won't see the buried core team guidance.

To summarize:

  • The core team won't entertain any proposals to deprecate or remove force-unwraps (or force tries). That includes a mode enabled via a compiler flag.
  • This is for more than just source compatibility reasons: we believe they are a legitimately useful part of the language.
  • Style discussions about when to use or avoid them is a fine discussion topic but should be done over on the "Using Swift" section of the forums
  • There is a potential topic of whether the Swift compiler should gain more general "linting" capabilities, which could enable an effect similar to a targeted "warn on force-unwrap" capability. The core team doesn't have any official position on whether this is a good or bad idea yet if anyone wanted to explore it. Discussion of this could be done on a spin-off topic (probably in the discussion section rather than pitches).
32 Likes