   ) -> Index? {
     var i = i
     let step = n.signum()
+    // The following line makes sure that index(_:offsetBy:limitedBy:) is
+    // invoked on the _base at least once, to trigger a _precondition in
+    // forward only collections.
+    _ensureBidirectional(step: step)
     for _ in 0 ..< abs(numericCast(n)) {
       if i == limit {
         return nil

      } while i != _base.endIndex && !_predicate(_base[i])
  }

  @_inlineable // FIXME(sil-serialize-all)
  public func index(_ i: Index, offsetBy n: Int) -> Index {
    var i = i
    let step = n.signum()
    for _ in 0 ..< abs(numericCast(n)) {
      _advanceIndex(&i, step: step)
    }

    i = index
  }

  @inline(__always)
  @_inlineable // FIXME(sil-serialize-all)
  @_versioned // FIXME(sil-serialize-all)
