Commit Graph

3089 Commits

Author SHA1 Message Date
Ben Cohen
8ca0df6074 Merge pull request #6542 from airspeedswift/who-fixes-the-fixmes
[stdlib] Tag a handful of additional issues with FIXME(ABI)
2017-01-04 18:43:04 -08:00
Ben Cohen
6bb212cb26 Merge pull request #6538 from airspeedswift/int-string-radix-default
[stdlib] Combine String.init(Integer) with and without radix
2017-01-04 18:42:17 -08:00
Xiaodi Wu
a698ca906b Address reviewer comments 2017-01-04 15:16:50 -06:00
swift-ci
f801430025 Merge pull request #6517 from sigito/patch-2 2017-01-03 19:51:16 -08:00
JP Simard
65688bdc39 [gardening] replace unused closure parameters with '_' in stdlib source (#6522)
* replace unused closure parameters with '_' in stdlib source

* fold some _ closure arguments into line above

* fold more _ closure arguments into line above
2017-01-03 20:10:41 -07:00
Joe Groff
796df2dc44 Merge pull request #6429 from jckarter/type-of-by-overload-resolution
`withoutActuallyEscaping`
2017-01-03 18:47:29 -08:00
Ben Cohen
9a4349ce89 Combine String.init with and without radix 2017-01-03 18:39:59 -08:00
Ben Cohen
28114baeb9 Flag various FIXMEs as ABI-impacting 2017-01-03 18:36:20 -08:00
Robert Widmann
e1822bccfa Merge pull request #6516 from sigito/patch-1
Removed repetitive docstring
2017-01-03 17:35:37 -07:00
JP Simard
7301b79342 remove superfluous parentheses in control statements in stdlib source
since this appears to be the convention followed elsewhere in the code base.
2016-12-31 18:40:15 -08:00
Yurii Samsoniuk
2b62ed250a Updated index(_:offsetBy:limitedBy:) code example 2016-12-31 15:48:52 +01:00
Yurii Samsoniuk
faa7c749df Removed repetitive docstring 2016-12-31 15:19:44 +01:00
Xiaodi Wu
539dc2a6d0 Add doc comments for initializers for literals 2016-12-28 15:13:28 -05:00
Joe Groff
0c9297862f Sema: Handle type-checking for withoutActuallyEscaping.
withoutActuallyEscaping has a signature like `<T..., U, V, W> (@nonescaping (T...) throws<U> -> V, (@escaping (T...) throws<U> -> V) -> W) -> W, but our type system for functions unfortunately isn't quite that expressive yet, so we need to special-case it. Set up the necessary type system when resolving an overload set to reference withoutActuallyEscaping, and if a type check succeeds, build a MakeTemporarilyEscapableExpr to represent it in the type-checked AST.
2016-12-22 17:51:26 -08:00
Joe Groff
1889fde228 Resolve type(of:) by overload resolution rather than parse hackery.
`type(of:)` has behavior whose type isn't directly representable in Swift's type system, since it produces both concrete and existential metatypes. In Swift 3 we put in a parser hack to turn `type(of: <expr>)` into a DynamicTypeExpr, but this effectively made `type(of:)` a reserved name. It's a bit more principled to put `Swift.type(of:)` on the same level as other declarations, even with its special-case type system behavior, and we can do this by special-casing the type system we produce during overload resolution if `Swift.type(of:)` shows up in an overload set. This also lays groundwork for handling other declarations we want to ostensibly behave like normal declarations but with otherwise inexpressible types, viz. `withoutActuallyEscaping` from SE-0110.
2016-12-22 16:28:31 -08:00
Nate Cook
0a0c77ed3f Merge pull request #6275 from natecook1000/nc-revise-pointers
[stdlib] Revise unsafe pointers documentation
2016-12-22 15:19:51 -06:00
Nate Cook
4edccfef63 [stdlib] Change wording in UnsafeBufferPointer discussion 2016-12-22 12:54:26 -06:00
swift-ci
6805ecccae Merge pull request #6311 from natecook1000/nc-fixes-06 2016-12-21 21:28:48 -08:00
practicalswift
ce7a10474f [gardening] Fix accidental double and triple spaces. 2016-12-21 22:13:56 +01:00
Nate Cook
606bf83af3 [stdlib] Modify intro sort to pivot on median of 3
This modifies the _partition function used during sorting to select
the median of the first, middle, and last elements in the range to
be partitioned. Before partitioning begins, those three elements are
sorted, after which the middle element is selected as the pivot. This
change improves performance for sorted or nearly-sorted data.
2016-12-21 13:19:42 -06:00
Max Moiseev
d9013a4b62 Adding endianness related inits and properties to FixedWidthInteger 2016-12-20 15:54:25 -08:00
Philippe Hausler
7d01c5d851 Add a fast-path case for enumeration of keys and objects for bridged Dictionaries 2016-12-20 15:16:48 -08:00
Nate Cook
77fc4948cc [stdlib] Add note about pointer alignment for subtraction 2016-12-20 12:39:01 -06:00
Ben Cohen
11e8a1feda Merge pull request #6388 from airspeedswift/_assertFailure-labels
[stdlib] Adjust _assertionFailed signature for naming guidelines
2016-12-20 08:49:59 -08:00
Max Moiseev
138d9df43e Getting rid of no longer needed minimumSignedRepresentationBitWidth 2016-12-19 16:26:15 -08:00
Max Moiseev
51128d3547 Adding smart shift default implementations to BinaryInteger via an extension 2016-12-19 16:10:24 -08:00
Max Moiseev
4675e12bc6 Implementing non-mutating shifts using mutating ones (for consistency) 2016-12-19 15:28:18 -08:00
Max Moiseev
4c1cc0f885 Moving bitwise operations and shifts to BinaryInteger protocol 2016-12-19 15:19:04 -08:00
Max Moiseev
059f7a53e2 doubleWidth operations on Int64 need special implementation for 32bit platforms 2016-12-19 14:42:33 -08:00
Max Moiseev
3276aa5bcf Merge remote-tracking branch 'origin/master' into new-integer-protocols 2016-12-19 13:15:50 -08:00
Nate Cook
4169635a20 [stdlib] Consistency fixes in Array documentation
- Removed "see other" note from type discussion
- Modified index(_:offsetBy...) to match other collections
- Word choice in reserveCapacity(_:)
2016-12-19 14:16:36 -06:00
Nate Cook
82811c57f0 [stdlib] Improvements to Collection doc comments 2016-12-19 13:05:19 -06:00
Ben Cohen
f089e16c61 kill another FIXME I missed 2016-12-19 09:53:40 -08:00
Ben Cohen
14bbb92466 Adjust _assertionFailed signature for naming guidelines 2016-12-19 08:51:42 -08:00
Paul Hudson
94ef84b649 Minor style fix: added space before brace. 2016-12-18 19:15:13 +00:00
Max Moiseev
ea8f2209a3 Overflow checks in division/modulo operators + tests 2016-12-15 16:32:07 -08:00
Max Moiseev
d318ec540c Type hints in comparisons 2016-12-15 16:31:19 -08:00
Max Moiseev
9518082c3f Removing dead and commented code 2016-12-15 15:22:54 -08:00
Max Moiseev
d7e92a5bc5 Using masking shifts 2016-12-15 14:53:56 -08:00
Max Moiseev
61b923f396 Using init(extendingOrTruncating:) instead of a deprecated init(truncatingBitPattern:) 2016-12-15 14:53:31 -08:00
Nate Cook
f2bc719eff [stdlib] Address feedback from @stephentyrone 2016-12-15 13:55:38 -06:00
Nate Cook
a14daa0c44 [stdlib] Address feedback from @gottesmm 2016-12-15 13:52:33 -06:00
Nate Cook
e070568078 [stdlib] Add documentation for pointer operators 2016-12-15 13:51:32 -06:00
Nate Cook
3bc4909de8 [stdlib] Various revisions and fixes for documentation
- Fix wording for RandomAccessCollection
- Add note about array growth to reserveCapacity(_:)
- Reformat lazy flatMap discussions
- Improve Collection symbol consistency
2016-12-15 11:47:19 -06:00
Max Moiseev
9a8cdbc703 Merge branch 'master' into new-integer-protocols 2016-12-14 17:18:02 -08:00
Max Moiseev
701740a884 Revert "Speeding up the generic smart shift"
This reverts commit 26111e8dd8.
2016-12-14 13:54:37 -08:00
Max Moiseev
26111e8dd8 Speeding up the generic smart shift 2016-12-14 13:54:28 -08:00
Nate Cook
7494e2045e [stdlib] Revise unsafe pointers documentation
This revises and expands upon documentation for the standard library's
unsafe pointer types. This includes typed and raw pointers and buffers,
the MemoryLayout type, and some other top-level functions.
2016-12-14 14:58:24 -06:00
Robert Widmann
be9f205115 Merge pull request #6246 from CodaFi/the-farmer-refuted
[Stdlib][ABI] Resolve ABI FIXME #25
2016-12-14 12:20:45 -05:00
Max Moiseev
7a8a840071 Fixing a typo 2016-12-13 16:16:37 -08:00