(defn parse-new
[[_ class & args :as form] env]
(when-not (>= (count form) 2)
(throw (ex-info (str "Wrong number of args to new, had: " (dec (count form)))
(merge {:form form}
(-source-info form env)))))
(let [args-env (ctx env :ctx/expr)
args (mapv (analyze-in-env args-env) args)]
{:op :new
:env env
:form form
:class (analyze-form class (assoc env :locals {})) ;; avoid shadowing
:args args
:children [:class :args]}))