private function addNamedTokens(array $oldTokens, array $addTokens, string $errorType): array
    {
        $dup_keys = array_intersect_key($oldTokens, $addTokens);
        if ($dup_keys) {
            throw new \InvalidArgumentException(
                "Cannot redefine $errorType: " . join(', ', array_keys($dup_keys))
            );
        }

        return $oldTokens + $addTokens;
    }