Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

Improve errors from refer #142

Merged
merged 2 commits into from
Jun 16, 2016
Merged

Improve errors from refer #142

merged 2 commits into from
Jun 16, 2016

Conversation

arrdem
Copy link
Collaborator

@arrdem arrdem commented Jun 13, 2016

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.

@arrdem arrdem force-pushed the feature/require-errors branch 3 times, most recently from 4ad8d50 to fa65672 Compare June 13, 2016 03:04
arrdem added 2 commits June 12, 2016 20:56
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.
@arrdem arrdem force-pushed the feature/require-errors branch from fa65672 to 49b57c4 Compare June 13, 2016 03:56
@arrdem arrdem merged commit 0a69be3 into develop Jun 16, 2016
@arrdem
Copy link
Collaborator Author

arrdem commented Jun 16, 2016

Whelp. This was bugged. Sigh.

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

Successfully merging this pull request may close these issues.

1 participant