protected function resolve($type, array $data)
    {
        if ($this->registered($type)) {
            $f = $this->registry[$type];
            if ($f instanceof Closure) {
                return $f($data, $this->app);
            } else {
                return new $f($data);
            }
        } else {
            throw new Exception("Field type $type not registered");
        }
    }