[stdlib] Conversions to String.Index

Also, hide an initializer on String.Index that was unintentionally
public/visible by giving it an underscored keyword argument.

Testing comes next.

Swift SVN r24069
This commit is contained in:
Dave Abrahams
2014-12-22 15:30:56 +00:00
parent d6bdfc1cfe
commit f78b6b125a
3 changed files with 74 additions and 7 deletions

View File

@@ -74,7 +74,7 @@ extension String {
/// Return an `Index` corresponding to the given offset in our UTF-16
/// representation.
func _index(utf16Index: Int) -> Index {
return Index(String.UnicodeScalarView.Index(utf16Index, _core))
return Index(_base: String.UnicodeScalarView.Index(utf16Index, _core))
}
/// Return a `Range<Index>` corresponding to the given `NSRange` of