[stdlib] Eradicate IndexDistance associated type (#12641)

* Eradicate IndexDistance associated type, replacing with Int everywhere

* Consistently use Int for ExistentialCollection’s IndexDistance type.

* Fix test for IndexDistance removal

* Remove a handful of no-longer-needed explicit types

* Add compatibility shims for non-Int index distances

* Test compatibility shim

* Move IndexDistance typealias into the Collection protocol
This commit is contained in:
Ben Cohen
2017-12-08 12:00:23 -08:00
committed by GitHub
parent ddac6ab1b9
commit 4ddac3fbbd
60 changed files with 268 additions and 302 deletions

View File

@@ -1149,7 +1149,7 @@ func toIntRange<
S : StringProtocol
>(
_ string: S, _ maybeRange: Range<String.Index>?
) -> Range<Int>? where S.Index == String.Index, S.IndexDistance == Int {
) -> Range<Int>? where S.Index == String.Index {
guard let range = maybeRange else { return nil }
return