leonoel / missionary

A functional effect and streaming system for Clojure/Script
Eclipse Public License 2.0
620 stars 25 forks source link

Compiler Exception on Clojure 1.11.1 - No matching clause: :static-field #73

Closed AdamFrey closed 1 year ago

AdamFrey commented 1 year ago

Hi,

I'm running into a compiler exception from missionary / cloroutine when upgrading an application from Clojure 1.10.3 to Clojure 1.11.1. I've pared down the code I'm working with to a minimal reproduction case.

;; missionary b.26
;; clojure 1.11.1

(m/ap
 (let [{:keys [id]} (m/?= (m/seed [{:id 123} {:id 234}]))]
   id))

;; Unhandled clojure.lang.Compiler$CompilerException
;; Caused by java.lang.IllegalArgumentException
;; No matching clause: :static-field
;;  cloroutine.impl 472

on clojure 1.10.3 this code compiles and the code seems to work as I hope.

ognen commented 1 year ago

I am experiencing the same with the following code:

(defn- run-resolutions [resolutions]
  (m/ap
    (let [{:keys [thunk] :as resolution} (m/?= (m/seed resolutions))]
      (assoc resolution :result (m/? thunk)))))

Also Clojure 1.11.1

Noticing that, compilation passes if I remove the map destructuring in the let clause:

(defn- run-resolutions2 [resolutions]
  (m/ap
    (let [res (m/?= (m/seed resolutions))]
      (assoc res :result (m/? ((:thunk res)))))))
leonoel commented 1 year ago

Fixed in b.27