             _ (dbg-println :debug "PD ARGS" arguments)
             arguments (or arguments [])
             unresolved (count (filter variable? arguments))
+            _ (dbg-println :trace "PD UNRESOLVED" unresolved "ARGUMENTS" arguments)
             args (if (pos? unresolved)
-                   (resolve-arguments arguments ancestry-path)
+                   (resolve-arguments arguments ancestry-path pargs)
                    arguments)
             _ (dbg-println :debug "PD pclass-ctor_" pclass-ctor_)
             _ (dbg-println :debug "PD get-in" pclass name)

                ;; we have the wrong plant-class (because the IR always
                ;; has true or false)
                (let [plant-class (if (= :plant-fn-symbol type)
                                    (if (= name 'this) mpclass name)
                                    (get-in ir [mpclass :fields field :initial :pclass]))
                      plant-fn-primitive?
                      (get-in ir [plant-class :methods method :primitive])

        ]
    pclass-ctor_))

;; name-with-argvals multi-methods --------------------------------------

;; (defn name-with-argvals-dispatch [object]
;;   (:type object))

;; (defmulti name-with-argvals
;;   "Dispatch based on object type"
;;   #'name-with-argvals-dispatch
;;   :default :htn-object
;;   :hierarchy #'htn-hierarchy)

;; (defmethod name-with-argvals :htn-object
;;   [object]
;;   (str (:uid object)))


;; ;;Commented out since we've change the signature for resolve-arguments
;; ;; (defmethod name-with-argvals :htn-task
;; ;;   [object]
;; ;;   (let [{:keys [name arguments ancestry-path]} object
;; ;;         arguments (or arguments [])
;; ;;         unresolved (count (filter variable? arguments))
;; ;;         argvals (if (pos? unresolved)
;; ;;                   (resolve-arguments arguments ancestry-path)
;; ;;                   arguments)]
;; ;;     (apply str name (conj (vec (conj (interpose ", " argvals) "(")) ")"))))

;; (defmethod name-with-argvals :htn-method
;;   [object]
;;   (let [{:keys [name nonprimitive-task]} object
;;         method-name (str name)
;;         {:keys [name arguments]} nonprimitive-task]
;;     (str
;;       method-name
;;       (str name (or (seq arguments) '())))))

;; (defmethod name-with-argvals :htn-expanded-method
;;   [object]
;;   (let [{:keys [expansion-method argument-mappings]} object
;;         {:keys [name nonprimitive-task]} expansion-method
;;         method-name (str name)
;;         {:keys [name arguments]} nonprimitive-task
;;         argvals (apply str (interpose " " (map #(get argument-mappings %) arguments)))]
;;     (str method-name "(" argvals ")")))


;; print-object multi-methods --------------------------------------

