Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructuring regression for defmethod #292

Closed
cldwalker opened this issue Dec 23, 2022 · 3 comments
Closed

Destructuring regression for defmethod #292

cldwalker opened this issue Dec 23, 2022 · 3 comments

Comments

@cldwalker
Copy link

Hi @borkdude. Encountered this bug while upgrading nbb-features. It is easy to work around this destructuring bug but thought you should know


version

1.1.155

platform

osx 12.0.1 and node 16.13.1

problem

When destructuring inside of a defmethod argument, the destructuring bindings are not recognized

repro

nbb-logseq -e "(require '[cljs.test :as t]) (defmethod t/report [::t/default :end-run-tests] [{:keys [error fail]}] (prn :ERR error))"
---- Error --------------------------------------
Message:  Could not resolve symbol: error
Location: 1:102
Phase:    analysis
...

expected behavior

I expected the above to evaluate without error. This evaluates fine with 0.7.135

@borkdude
Copy link
Collaborator

borkdude commented Dec 23, 2022 via email

@borkdude
Copy link
Collaborator

Yeah, this indeed looks weird:

 $ ./cli.js -e "(macroexpand '(defmethod foo ::dude [k {:keys [a]}] a))"
(clojure.core/multi-fn-add-method-impl foo :user/dude (fn* [k {:keys [a]}] a))

@cldwalker
Copy link
Author

That was quick. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants