Skip to content

Commit 1f68678

Browse files
author
Dave Abrahams
authored
[stdlib] Correct a comment
1 parent c497969 commit 1f68678

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stdlib/public/core/StringRangeReplaceableCollection.swift.gyb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ extension String : StringProtocol, RangeReplaceableCollection {
4242
self._core = CharacterView(other)._core
4343
}
4444

45-
// This initializer satisfies the LosslessStringConvertible conformance
45+
// The defaulted argument prevents this initializer from satisfies the
46+
// LosslessStringConvertible conformance. You can satisfy a protocol
47+
// requirement with something that's not yet available, but not with
48+
// something that has become unavailable. Without this, the code won't
49+
// compile as Swift 4.
4650
@available(swift, obsoleted: 4, message: "String.init(_:String) is no longer failable")
4751
public init?(_ other: String, obsoletedInSwift4: () = ()) {
4852
self.init(other._core)

0 commit comments

Comments
 (0)