stdlib: add a couple of ABI FIXMEs to String implementation

We should not make grapheme segmentation algorithm inlineable now (and
possibly ever).  The immediate reason is that Unicode 8.0 grapheme
segmentation algorithm has been changed significantly in Unicode 9.0.
Unicode 9.0 requires a stateful algorithm.  Current indices and
iterators just don't have the storage for that state, so we can't mark
them as fragile.
This commit is contained in:
Dmitri Gribenko
2016-08-10 18:05:25 -07:00
parent 1bd106cc80
commit d1801be1ef
3 changed files with 12 additions and 1 deletions

View File

@@ -577,6 +577,8 @@ extension String.UnicodeScalarIndex {
}
extension String.UnicodeScalarView {
// FIXME(ABI): don't make this function inlineable. Grapheme cluster
// segmentation uses a completely different algorithm in Unicode 9.0.
internal func _isOnGraphemeClusterBoundary(_ i: Index) -> Bool {
if i == startIndex || i == endIndex {
return true