Skip to content

def-transfer: emit correct :tag metadata #46

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

Merged
merged 2 commits into from
Jun 14, 2021

Conversation

vemv
Copy link
Contributor

@vemv vemv commented Jun 14, 2021

Reoccurrences are prevented by introducing Eastwood as a linter, which detected this issue in the first place.

Fixes #45

Reoccurrences are prevented by introducing Eastwood as a linter, which detected this issue in the first place.

Fixes clj-commons#45
@vemv vemv requested a review from slipset as a code owner June 14, 2021 07:57
(defmacro def-conversion
"Defines a conversion from one type to another."
[[src dst :as conversion] params & body]
(let [^Type src (normalize-type-descriptor src)
dst (normalize-type-descriptor dst)]
dst (normalize-type-descriptor dst)
src-meta (if-let [c (extract-class src)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to have a fn like (class-meta src)

(defn class-meta [^Type src]
  (if-let [c (extract-class src)
     {:tag c}
     {}))

or some variant of that? Maybe extract-class could be inlined?

@vemv
Copy link
Contributor Author

vemv commented Jun 14, 2021

Thanks for the review!

Fixed

@slipset slipset merged commit fd0477a into clj-commons:master Jun 14, 2021
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.

:tag metadata can be wrong
2 participants