   @inline(__always)
   @warn_unused_result
   internal func _advanceForward(
-    i: Index, by n: Index.Distance, limit: Index
+    i: Index, by n: IndexDistance, limit: Index
   ) -> Index {
     _precondition(n >= 0,
       "Only BidirectionalIndexType can be advanced by a negative amount")
 
     var i = i
-    for var offset: Index.Distance = 0; offset != n && i != limit; offset = offset + 1 {
+    for var offset: IndexDistance = 0; offset != n && i != limit; offset = offset + 1 {
       _nextInPlace(&i)
     }
     return i
   }
 
   @warn_unused_result
-  public func advance(i: Index, by n: Index.Distance) -> Index {
+  public func advance(i: Index, by n: IndexDistance) -> Index {
     return self._advanceForward(i, by: n)
   }
 
   @warn_unused_result
-  public func advance(i: Index, by n: Index.Distance, limit: Index) -> Index {
+  public func advance(i: Index, by n: IndexDistance, limit: Index) -> Index {
     return self._advanceForward(i, by: n, limit: limit)
   }
 
   @warn_unused_result
-  public func distanceFrom(start: Index, to end: Index) -> Index.Distance {
+  public func distanceFrom(start: Index, to end: Index) -> IndexDistance {
     var start = start
-    var count: Index.Distance = 0
+    var count: IndexDistance = 0
     while start != end {
       count = count + 1
       _nextInPlace(&start)


  var isEmpty: Bool { get }

  var count: Index.Distance { get }
}

extension MyForwardCollectionType {
  /// Do not use this method directly; call advancedBy(n) instead.
  @inline(__always)
  @warn_unused_result
  internal func _advanceForward(i: Index, by n: Index.Distance) -> Index {
    _precondition(n >= 0,
      "Only BidirectionalIndexType can be advanced by a negative amount")

    var i = i
    for var offset: Index.Distance = 0; offset != n; offset = offset + 1 {
      _nextInPlace(&i)
    }
    return i

  }

  @warn_unused_result
  public func advance(i: Index, by n: IndexDistance) -> Index {
    return i.advancedBy(n)
  }

  @warn_unused_result
  public func advance(i: Index, by n: IndexDistance, limit: Index) -> Index {
    let d = i.distanceTo(limit)
    if d == 0 || (d > 0 ? d <= n : d >= n) {
      return limit
