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

Consider whether to be using fatalErrors vs precondition/preconditionFailures

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.0.9
    • Component/s: None
    • Labels:

      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

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

                Dates

                Created:
                Updated:
                Resolved: