protected function keyTypeError(string $method, $key): string
    {
        $keyType = is_object($key) ? get_class($key) : gettype($key);

        return sprintf(
            '%s::%s expects key type (%s); received (%s) %s',
            static::class,
            $method,
            $this->keyType(),
            $keyType,
            VarPrinter::toString($key)
        );
    }