private function compilePath(RouteInterface $route, array $parameters, $host, $type, $name)
    {
        if (static::RELATIVE_PATH === $type && null !== $route->getHost()) {
            throw new \InvalidArgumentException(
                sprintf('Can\'t create relative path because route "%s" requires a deticated hostname.', $name)
            );
        }

        $context = $route->getContext();
        $prefix  = static::ABSOLUTE_PATH === $type ? $this->getPathPrefix($route, $host) : '';

        if (0 === count($vars = $context->getVars())) {
            return $this->getPrefixed($context->getStaticPath(), $prefix);
        }

        $parts      = [];
        $vars = $this->getRouteVars($context, $parameters);

        foreach ($context->getTokens() as $token) {
            if ($token instanceof Variable) {
                if ($token->required && !isset($vars[$token->value])) {
                    throw new \InvalidArgumentException(sprintf('{%s} is a required parameter.', $token->getValue()));
                }
                $parts[] = $vars[$token->value];
            } else {
                $parts[] = $token->value;
            }
        }

        return $this->getPrefixed(implode('', $parts), $prefix);
    }