Uploaded image for project: 'Swift Driver'
  1. Swift Driver
  2. SWIFT-261

Consider whether to be using fatalErrors vs precondition/preconditionFailures

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 0.0.9
    • None

    Description

      precondition and preconditionFailure are not evaluated in unchecked builds ( -Ouncheck), but fatalErrors are.

      we pretty much just use precondition/preconditionFailure everywhere. Swift std lib uses a mix of both.

      we should further research this and come up with a rule of thumb as to whether to use fatalError or precondition in various places, and correct any existing violations. 

      blog posts that seem promising for learning more:

      Attachments

        Issue Links

          Activity

            People

              patrick.freed@mongodb.com Patrick Freed
              kaitlin.mahar@mongodb.com Kaitlin Mahar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: