Commit Graph

94 Commits

Author SHA1 Message Date
Michael Ilseman
ccda8f33d1 [noescape by default] Proliferate @escaping
Adds an explicit @escaping throughout the standard library, validation
test suite, and tests. This will be necessary as soon as noescape is
the default for closure parameters.
2016-07-29 13:48:07 -07:00
John McCall
c8c41b385c Implement SE-0077: precedence group declarations.
What I've implemented here deviates from the current proposal text
in the following ways:

- I had to introduce a FunctionArrowPrecedence to capture the parsing
  of -> in expression contexts.

- I found it convenient to continue to model the assignment property
  explicitly.

- The comparison and casting operators have historically been
  non-associative; I have chosen to preserve that, since I don't
  think this proposal intended to change it.

- This uses the precedence group names and higherThan/lowerThan
  as agreed in discussion.
2016-07-26 14:04:57 -07:00
David Farler
7bfaeb57f1 [SE-0081] Warn on deprecated where clause inside angle brackets
and provide a fix-it to move it to the new location as referenced
in SE-0081.

Fix up a few stray places in the standard library that is still using
the old syntax.

Update any ./test files that aren't expecting the new warning/fix-it
in -verify mode.

While investigating what I thought was a new crash due to this new
diagnostic, I discovered two sources of quite a few compiler crashers
related to unterminated generic parameter lists, where the right
angle bracket source location was getting unconditionally set to
the current token, even though it wasn't actually a '>'.
2016-07-26 01:41:10 -07:00
Brian Gesiak
328de9e280 [SR-1738] add_swift_library takes SHARED/STATIC arg
As a first step to allowing the build script to build *only*
static library versions of the stdlib, change `add_swift_library`
such that callers must pass in `SHARED`, `STATIC`, or `OBJECT_LIBRARY`.

Ideally, only these flags would be used to determine whether to
build shared, static, or object libraries, but that is not currently
the case -- `add_swift_library` also checks whether the library
`IS_STDLIB` before performing certain additional actions. This will be
cleaned up in a future commit.
2016-06-16 13:15:58 -04:00
rintaro ishizaki
6401324993 [stdlib] Apply tail style "where" clause to stdlib/{internal,private} 2016-06-02 12:01:21 +09:00
Chris Lattner
8d3f88735d Add parens to the few cases in the stdlib that lack them for function types. 2016-05-06 21:07:08 -07:00
Dave Abrahams
debde16e2c Merge set-api branch into swift-3-indexing-model 2016-04-26 15:56:42 -07:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
Ted Kremenek
90ce8daf0b Merge pull request #1552 from hughbe/stdlib-newlines
[gardening] Remove double new lines from stdlib files
2016-03-05 14:40:04 -08:00
Hugh Bellamy
c1b25bb32f [gardening] Remove double new lines from stdlib files 2016-03-05 15:44:54 +00:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00
Daniel Duan
2bc78b8c09 [stdlib] update for 'inout' adjustment (SE-0031) 2016-02-26 12:02:29 -08:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Jordan Rose
a4a4a80ac4 [CMake] Don't pass -sil-serialize-all under SWIFT_STDLIB_ENABLE_RESILIENCE.
Thanks, Slava!
2016-02-10 10:29:01 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Maxim Moiseev
844b81c46b SequenceType => Sequence 2015-12-09 17:16:56 -08:00
Dmitri Gribenko
2cf172160c Rename SequenceType.Generator associated type to SequenceType.Iterator 2015-12-09 17:11:05 -08:00
Dmitri Hrybenko
28792f40b3 stdlib: add an API AnySequence.init(() -> Generator)
No objections on API review.

rdar://20720454

Swift SVN r28886
2015-05-21 20:56:38 +00:00
Dmitri Hrybenko
41fedd9183 stdlib: add an API AnySequence.init(() -> Generator)
This API is required for parity with SequenceOf.

Swift SVN r28808
2015-05-20 01:00:45 +00:00
Dave Abrahams
5c55682d8b [stdlib] Capitalize keywords in doc comments
Again, the text is a lot more readable that way.

Swift SVN r28472
2015-05-12 16:59:13 +00:00
Dave Abrahams
106b39a497 [stdlib] Indent bullet continuations in doc comments
The text is a lot more readable that way.

Swift SVN r28471
2015-05-12 16:59:08 +00:00
Dave Abrahams
d576eb9e63 [stdlib] Merge experimental inheritance support for mirrors
Swift SVN r27934
2015-04-29 22:21:46 +00:00
Ted Kremenek
ea498e9fef Revert "[stdlib] Merge experimental inheritance support for mirrors"
This is breaking the Jenkins build.

Swift SVN r27919
2015-04-29 20:27:36 +00:00
Dave Abrahams
9407cc5ab8 [stdlib] Merge experimental inheritance support for mirrors
Swift SVN r27918
2015-04-29 20:13:49 +00:00
Enrico Granata
4781414e7a Remove SwiftExperimental.dump() - I am iterating on this as part of LLDB
Swift SVN r27882
2015-04-28 21:12:00 +00:00
David Farler
9e28dc777a Update standard library doc comments to Markdown
rdar://problem/20180478

Swift SVN r27726
2015-04-26 00:07:11 +00:00
Dmitri Hrybenko
8a3e78f3a7 Mirrors can be compiled on non-ObjC runtime
Swift SVN r27716
2015-04-25 03:45:01 +00:00
Dave Abrahams
ccffa33dbe [stdlib] Apply class Mirror review feedback
* Updated and fixed comments

* Use CustomLeafReflectable conformance rather than an argument to the
  mirror constructor to denote class cluster roots

* Provide access to the subject type of the mirror

Swift SVN r27708
2015-04-24 20:51:03 +00:00
Doug Gregor
793b3326af Implement the new rules for argument label defaults.
The rule changes are as follows:
  * All functions (introduced with the 'func' keyword) have argument
  labels for arguments beyond the first, by default. Methods are no
  longer special in this regard.
  * The presence of a default argument no longer implies an argument
  label.

The actual changes to the parser and printer are fairly simple; the
rest of the noise is updating the standard library, overlays, tests,
etc.

With the standard library, this change is intended to be API neutral:
I've added/removed #'s and _'s as appropriate to keep the user
interface the same. If we want to separately consider using argument
labels for more free functions now that the defaults in the language
have shifted, we can tackle that separately.

Fixes rdar://problem/17218256.

Swift SVN r27704
2015-04-24 19:03:30 +00:00
Enrico Granata
2218118cd9 This is a version of dump() based on the new Mirror API
This is meant as both a porting effort and as an experimental bench for things the debugger might want dump() to do



Swift SVN r27697
2015-04-24 18:28:25 +00:00
Dave Abrahams
2a1ce9fca8 [stdlib] Mirror: minor pre-review cleanups
Swift SVN r27640
2015-04-23 19:52:38 +00:00
Chris Lattner
cd74bbd49b convert some as? bindings in if/let patterns to use 'as' patterns, suggested by Joe. NFC.
Swift SVN r27628
2015-04-23 04:35:52 +00:00
Dave Abrahams
f82b18e1e5 [stdlib] Mirror: descendant class suppression
Swift SVN r27593
2015-04-22 17:23:59 +00:00
Dave Abrahams
d3f52de076 [stdlib] Mirror: handle chaining
Swift SVN r27592
2015-04-22 17:23:58 +00:00
Dave Abrahams
5f30f6bf23 [stdlib] Mirror: internal renaming
Swift SVN r27591
2015-04-22 17:23:57 +00:00
Dave Abrahams
877056f1fb [stdlib] Mirror: store descendant representation
Swift SVN r27590
2015-04-22 17:23:56 +00:00
Dave Abrahams
45d72b9a02 [stdlib] Reorder Mirror parameters to match docs
Swift SVN r27589
2015-04-22 17:23:55 +00:00
Dave Abrahams
d955f0fae3 [stdlib] Revise Mirror initializer documentation
...explaining how the ancestor and descendant representation options
affect the result.  NFC.

Swift SVN r27588
2015-04-22 17:23:55 +00:00
Dave Abrahams
ee72b0dc2f [stdlib] Mirror: internal factorization
Swift SVN r27587
2015-04-22 17:23:54 +00:00
Dave Abrahams
90c7832264 [stdlib] Mirror: store the subjectType
We'll need this to properly handle CustomReflectable classes that don't
override customMirror().

Swift SVN r27504
2015-04-20 21:58:27 +00:00
Dave Abrahams
a711b508cc [stdlib] SuperMirror renaming
also changed superclassMirror into a method, since I don't have any
confidence it's going to be O(1).

Swift SVN r27503
2015-04-20 21:58:26 +00:00
Dave Abrahams
702900eb87 [stdlib] Basic support for chained super-mirrors
Does not yet inject synthesized mirrors for intermediate classes.

Swift SVN r27502
2015-04-20 21:58:25 +00:00
Dave Abrahams
38f0dce7ba [stdlib] Synthesized and Suppressed Super-Mirrors
Next up: chaining to the mirror for a customized base class

Swift SVN r27501
2015-04-20 21:58:25 +00:00
Dave Abrahams
62d958e322 [stdlib] Supply base class mirrors, v2
Swift SVN r27499
2015-04-20 21:58:23 +00:00
Dave Abrahams
60ba4d49f7 [stdlib] s/baseClass/superclass/ in Mirrors
Swift SVN r27498
2015-04-20 21:58:22 +00:00
Dave Abrahams
e905e7dc31 [stdlib] Supply base class mirrors
Swift SVN r27497
2015-04-20 21:58:22 +00:00
Dave Abrahams
0c8a717896 [stdlib] Don't report base as a Mirror child
This results in silly infinite recursions.  We need an API change to
access the base instance mirror.

Swift SVN r27496
2015-04-20 21:58:21 +00:00
Dave Abrahams
d31a01e2ca [stdlib] Mirror: s/instance/subject/ where possible
"Subject" is a little more specific about the role it plays in the mirror.

Swift SVN r27495
2015-04-20 21:58:20 +00:00
Dave Abrahams
754414c02d [stdlib] Copy mirrors back to SwiftExperimental
So we can do API-breaking work

Swift SVN r27494
2015-04-20 21:58:19 +00:00