mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user