Commit Graph

4 Commits

Author SHA1 Message Date
Doug Gregor
7764f64cf8 Simplify assertion machinery in the standard library.
This change includes a number of simplifications that allow us to
eliminate the type checker hack that specifically tries
AssertString. Doing so provides a 25% speedup in the
test/stdlib/ArrayNew.swift test (which is type-checker bound).

The specific simplifications here:
  - User-level
  assert/precondition/preconditionalFailure/assertionFailer/fatalError
  always take an autoclosure producing a String, eliminating the need
  for the StaticString/AssertString dance.
  - Standard-library internal _precondition/_sanityCheck/etc. always
  take a StaticString. When we want to improve the diagnostics in the
  standard library, we can provide a separate overload or
  differently-named function.
  - Remove AssertString, AssertStringType, StaticStringType, which are
  no longer used or needed
  - Remove the AssertString hack from the compiler
  - Remove the "BooleanType" overloads of these functions, because
  their usefuless left when we stopped making optional types conform
  to BooleanType (sorry, should have been a separate patch).



Swift SVN r22139
2014-09-19 17:56:50 +00:00
Dmitri Hrybenko
cae11e1e41 stdlib/Assert: add overloads for assertionFailure(), preconditionFailure(),
fatalError() that accept string interpolation

rdar://18043533


Swift SVN r21250
2014-08-18 10:48:52 +00:00
Dmitri Hrybenko
5746e4e9ca stdlib: rename _fatalError to _sanityCheckFailure. Name similarity between
fatalError and _fatalError has caused some damage already, as some
memory-safety checks in Mirrors are _fatalErrors.


Swift SVN r20969
2014-08-03 15:20:37 +00:00
Dmitri Hrybenko
142a32a944 stdlib/Assert: allow string interpolation in assertion messages
rdar://17248446


Swift SVN r20892
2014-08-01 13:44:38 +00:00