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
This commit is contained in:
Doug Gregor
2015-04-24 19:03:30 +00:00
parent 2f15b53fe8
commit 793b3326af
189 changed files with 692 additions and 712 deletions

View File

@@ -341,7 +341,7 @@ extension String.UnicodeScalarView : RangeReplaceableCollectionType {
/// :param: `keepCapacity`, if `true`, prevents the release of
/// allocated storage, which can be a useful optimization
/// when `self` is going to be grown again.
public mutating func removeAll(keepCapacity: Bool = false) {
public mutating func removeAll(#keepCapacity: Bool = false) {
Swift.removeAll(&self, keepCapacity: keepCapacity)
}
}