protected function resolveFuncArgs(Func $func)
    {
        $params = $this->reader->read($func);

        $args = array();
        foreach ($params as $param) {

            $name = $param->name;
            $inst = $this->tryService($name);

            if (!$inst && $param->hasDefault) {
                $args[$name] = $param->default;
            } else if ($inst && $param->type && $this->checker->validate($param->type, $inst)) {
                $args[$name] = $inst;
            } else if ($inst && $param->type && !$this->checker->validate($param->type, $inst)) {
                throw new ResolutionException("Parameter type is not compatible with service '$name'");
            } else if ($inst) {
                $args[$name] = $inst;
            } else {
                throw new ResolutionException("Could not resolve parameter '$name'");
            }
        }

        return $args;
    }