readRelativePosition = decoder => {
  let type = null;
  let tname = null;
  let itemID = null;

  switch (decoding.readVarUint(decoder)) {
    case 0:
      // case 1: found position somewhere in the linked list
      itemID = readID(decoder);
      break;

    case 1:
      // case 2: found position at the end of the list and type is stored in y.share
      tname = decoding.readVarString(decoder);
      break;

    case 2:
      {
        // case 3: found position at the end of the list and type is attached to an item
        type = readID(decoder);
      }
  }

  const assoc = decoding.hasContent(decoder) ? decoding.readVarInt(decoder) : 0;
  return new RelativePosition(type, tname, itemID, assoc);
}
@param {decoding.Decoder} decoder
@return {RelativePosition}

@function