When a substring gets bridged to NSString, it loses the initial offset,
therefore APIs that accept or return StringIndex ranges should handle
this case explicitly by adding/subtracting the substring start offset.
Fixes <rdar://problem/33873277>
These tests included sources that are
based on Swift 3. They can be considered to be updated later to Swift 4, but it did not seem critical for what they were testing.
This decreases total testing time by over a minute on my old Mac Pro.
It probably has much less effect on systems with fewer cores, but shouldn't
be any worse there.
Swift SVN r22745
The name was not only long and unwieldy, but inconsistent with our
conscious decision to avoid the use of "elements" in APIs as mostly
redundant.
Swift SVN r22408
Expose any, all on Array and all the Lazy sequence adapters. Make the
'contains' algorithm that takes a predecate unavailable in favor of
'any', which does the same thing.
Fixes <rdar://problem/18190149> [algorithm] `contains` syntax is ambiguous
Swift SVN r21810
The syntax being reverted added busywork and noise to the common case
where you want to say "I have the right address, but the wrong type,"
without adding any real safety.
Also it eliminated the ability to write UnsafePointer<T>(otherPointer),
without adding ".self" to T. Overall, it was not a win.
This reverts commits r21324 and r21342
Swift SVN r21424
Previously, it was possible to write Unsafe[Mutable]Pointer(x) and have
Swift deduce the pointee type based on context. Since reinterpreting
memory is a fundamentally type-unsafe operation, it's better to be
explicit about conversions from Unsafe[Mutable]Pointer<T> to
Unsafe[Mutable]Pointer<U>. This change is consistent with the move from
reinterpretCast(x) to unsafeBitCast(x, T.self).
Also, we've encoded the operations of explicitly adding or removing
mutability as properties, so that adding mutability can be separated
from wild reinterpretCast'ing, a much more severe form of unsafety.
Swift SVN r21324
The test harness now can recover after test crashes, allowing:
- check for crashes themselves (without reporting them to the Python lit driver,
which is about 10x slower -- even if CrashTracer is disabled);
- recover from unexpected test crashes and run the rest of the tests;
- this lays the groundwork for assertions that end the test execution, but
allow the rest of the tests to run (rdar://17906801).
Note that we don't spawn a fresh process for every test. We create a child
process and reuse it until it crashes.
Swift SVN r21090
stringByAddingPercentEncodingWithAllowedCharacters() and
stringByAddingPercentEscapesUsingEncoding() to String?, and add API notes for
NSString to the same effect
Swift SVN r21007
In answering a forum post I noiced that I wanted this and it was
missing.
Also, extensive comments
Also, rename the length: init parameter to count:. When writing the
comments for the init function it became painfully clear why we use
"count" is better than "length" especially around pointers and memory:
the former is much less easy to mistake for "length in bytes". Plus
it's consistent with the new ".count" property
Swift SVN r20609