popChoiceContext() {
    const context = this.choiceContext;

    this.choiceContext = context.upper;

    const forkContext = this.forkContext;
    const headSegments = forkContext.head;

    switch (context.kind) {
      case '&&':
      case '||':
      case '??':
        /*
         * If any result were not transferred from child contexts,
         * this sets the head segments to both cases.
         * The head segments are the path of the right-hand operand.
         */
        if (!context.processed) {
          context.trueForkContext.add(headSegments);
          context.falseForkContext.add(headSegments);
          context.qqForkContext.add(headSegments);
        }

        /*
         * Transfers results to upper context if this context is in
         * test chunk.
         */
        if (context.isForkingAsResult) {
          const parentContext = this.choiceContext;

          parentContext.trueForkContext.addAll(context.trueForkContext);
          parentContext.falseForkContext.addAll(context.falseForkContext);
          parentContext.qqForkContext.addAll(context.qqForkContext);
          parentContext.processed = true;

          return context;
        }

        break;

      case 'test':
        if (!context.processed) {
          /*
           * The head segments are the path of the `if` block here.
           * Updates the `true` path with the end of the `if` block.
           */
          context.trueForkContext.clear();
          context.trueForkContext.add(headSegments);
        } else {
          /*
           * The head segments are the path of the `else` block here.
           * Updates the `false` path with the end of the `else`
           * block.
           */
          context.falseForkContext.clear();
          context.falseForkContext.add(headSegments);
        }

        break;

      case 'loop':
        /*
         * Loops are addressed in popLoopContext().
         * This is called from popLoopContext().
         */
        return context;

      /* c8 ignore next */
      default:
        throw new Error('unreachable');
    }

    // Merges all paths.
    const prevForkContext = context.trueForkContext;

    prevForkContext.addAll(context.falseForkContext);
    forkContext.replaceHead(prevForkContext.makeNext(0, -1));

    return context;
  }
Pops the last choice context and finalizes it.
@throws {Error} (Unreachable.)
@returns {ChoiceContext} The popped context.