public function addResolverType(string $type, string $path, string $extension = "", SubResolver $instance = null)
    {
        // Check argument validity
        if (isset($this->resolvers[$type]))
            throw new \LogicException("Duplicate resolver type: " . $type);

        if ($instance !== null && $extension !== "")
            throw new \LogicException("Cannot set a file extension for a provided instance");

        // Instantiate a new resolver when none has been passed
        if ($instance === null)
            $instance = new SubResolver($type, $extension);

        $this->resolvers[$type] = [
            'path' => $path,
            'resolver' => $instance
        ];

        if ($this->cache)
            $this->resolvers[$type]['resolver']->setCache($this->cache);

        // Register found modules with the new resolver
        foreach ($this->modules as $name => $module_path)
            if (is_dir($module_path . DIRECTORY_SEPARATOR . $path))
                $instance->addToSearchPath($name, $path);

        return $this;
    }