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

Fix namespaced symbols in syntax quoted binding vector #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yuhan0
Copy link

@yuhan0 yuhan0 commented Mar 22, 2025

These underscores in a syntax quoted form cause the macroexpansion to contain the following technically invalid binding forms (even if deftype accepts it without complaining)

(clojure.core/deftype ...
  (meta [potemkin.collections/_] ...)
  (with-meta [potemkin.collections/_ x__1234__auto__] ...)
  ...)

@yuhan0 yuhan0 requested a review from slipset as a code owner March 22, 2025 13:24
@slipset
Copy link
Member

slipset commented Mar 24, 2025

Could I ask you to add a test which demonstrates the breaking prior to this fix, and that passes after this fix?

@yuhan0
Copy link
Author

yuhan0 commented Mar 24, 2025

I don't think there are any observed breakages due to the prior behaviour, because clojure.core.deftype is lenient enough to accept a binding vector with namespaced symbols.

(deftype Foo []
  Object
  (toString [invalid/binding]
    "no error"))

This PR simply makes the output more robust, in case tooling or future versions decide to treat this as invalid.

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

Successfully merging this pull request may close these issues.

2 participants