Skip to content

[#347] Add regression test for namespaces that set! *warn-on-reflection*#425

Merged
bbatsov merged 1 commit intomasterfrom
fix-347-warn-on-reflection
May 9, 2026
Merged

[#347] Add regression test for namespaces that set! *warn-on-reflection*#425
bbatsov merged 1 commit intomasterfrom
fix-347-warn-on-reflection

Conversation

@bbatsov
Copy link
Copy Markdown
Member

@bbatsov bbatsov commented May 9, 2026

The original report (refactor-nrepl 2.5.1, 2021) was that building an AST for a namespace with (set! *warn-on-reflection* true) at the top level threw Can't set!: *warn-on-reflection* from non-binding thread. I couldn't reproduce it against the current tools.analyzer.jvm (1.3.4) - both .clj and .cljc cases build cleanly.

Adding two fixtures to ns-ast-test so we catch any future analyzer/tooling update that re-breaks this. No production code change.

Once this lands I'd close #347 as resolved-upstream.

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (run lein do clean, test)
  • Code inlining with mranderson works and tests pass with inlined code (run make install -- takes a long time)
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

The original report (refactor-nrepl 2.5.1, 2021) no longer reproduces
against tools.analyzer.jvm 1.3.4 - building an AST for a namespace that
sets *warn-on-reflection* (or *unchecked-math*) at the top level
succeeds in both .clj and .cljc files. Pin that down with a regression
test using two new fixtures so we catch any future analyzer/tooling
update that breaks it again.
@bbatsov bbatsov merged commit b5725aa into master May 9, 2026
25 checks passed
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.

Setting *warn-on-reflection* prevents symbol renaming

1 participant