-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix reflection warning #2696
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 reflection warning #2696
Conversation
It was a change left from debugging
It's already type hinted in the let
|
It's not different. I thought it was unintentionally removed at some point. I expected there to be tests for any known regressions like that... If you have a repro I could add to the lein test suite please advise. Currently I can only repro by running |
Workaround to resolve reflection warning while avoiding #2328
form can be a single symbol and can't filter that...
|
I added a hacky fix using metadata to tag the form in question. Stuff without the magical meta tag won't have metadata printed (this is current behavior). I added a test case for this as well. The last test failure seems to be a maven connection refused error... I can't rerun the tests on Circle to check if time resolves it |
|
I don’t remember what the problem was, aren’t all projects with plugins affected? Anyway, I cannot look into this further. |
|
Perhaps we can always use |
|
After some investigation, my idea isn't going to work because you can't remove metadata from vars and other such objects with mutable metadata. I'll experiment with hybrid of these approaches (use a flag like in this PR to signal a very strict use of |
| (binding [*print-dup* *eval-print-dup* | ||
| ;; only to resolve reflection warning in run-form (run.clj) | ||
| *print-meta* (and (seq? form) | ||
| (first (filter #(:lein-with-meta (meta %)) form)))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is going to have the desired effect because most calls to shell-command wrap their arguments with extra forms. For example, see impl of eval-in-project and leiningen.trampoline's use of shell-command.
EDIT: Ah, now I understand that you've probably considered this case, that's why the filter is there right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the feeling this approach is still too dangerous because there might be var literals in a project's :global-vars or :injections, and they contain unreadable Namespace objects in their metadata (assuming my understanding is correct that most calls to shell-command will come via eval-in-project).
Fixes #2695
*print-meta* truea'la Type-hint leiningen.run/run-form and print metadata in eval file #2306Tests are passing.