This repository has been archived by the owner on Jan 28, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch promotes #'clojure.core/refer to a macro, so that generated errors are source location precise. This fixes a UX defect where code using refer would be loaded, and the warnings about refer's deprecation and the replacement text would be generated at separate times.
Previously, the deprecated symbol warning (generated when analyzing a usage of
require
) would occur and then later after any other analysis warnings the deprecated usage message would be generated when the fully macroexpanded form is evaluated. This means that other errors and messages with other causes could be generated first. This patch ensures that the replacement message will be generated immediately after the deprecated symbol warning.The primary limitation of this patch is that it has to do some unquoting nonsense which is pretty fragile when users are using refer inline, as in the test suite. However since the whole line of reasoning with this work is that refer should be deprecated and eventually removed I don't have a huge issue with making it fragile for now.