diff --git a/Foundation/String.swift b/Foundation/String.swift index 053274c97a..4092a6bf2f 100644 --- a/Foundation/String.swift +++ b/Foundation/String.swift @@ -74,7 +74,10 @@ extension String { /// Return an `Index` corresponding to the given offset in our UTF-16 /// representation. func _index(_ utf16Index: Int) -> Index { - return Index(_base: String.UnicodeScalarView.Index(utf16Index, _core)) + return Index( + _base: String.UnicodeScalarView.Index(_position: utf16Index), + in: characters + ) } /// Return a `Range` corresponding to the given `NSRange` of