(defn analyze-host-field
[target-type field target-expr class env]
(if class
(case target-type
:static (or (maybe-static-field (list '. class field))
(throw (ex-info (str "Cannot find field "
field " for class " class)
(merge {:class class
:field field}
(source-info env)))))
:instance (or (maybe-instance-field target-expr class field)
{:op :host-interop
:target (dissoc target-expr :tag :validated?)
:m-or-f field
:assignable? true
:children [:target]}
(when (:literal? target-expr)
(throw (ex-info (str "Cannot find field "
field " for class " class)
(merge {:instance (dissoc target-expr :env)
:field field}
(source-info env)))))))
{:op :host-interop
:target target-expr
:m-or-f field
:assignable? true
:children [:target]}))