Skip to content

Fix precompilation: remove duplicate _foreach_typed_tolerant definition#40

Merged
tbeason merged 1 commit into
mainfrom
fix-precompile-method-dup
Jun 22, 2026
Merged

Fix precompilation: remove duplicate _foreach_typed_tolerant definition#40
tbeason merged 1 commit into
mainfrom
fix-precompile-method-dup

Conversation

@tbeason

@tbeason tbeason commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Problem

src/store.jl defines the internal _foreach_typed_tolerant helper twice — an identical copy-paste of the function and its full doc comment (introduced alongside the tolerant-decode work in #30/#36). On Julia 1.12+ this fails module precompilation:

WARNING: Method definition _foreach_typed_tolerant(...) in module DatabentoAPI at src/store.jl:71 overwritten at src/store.jl:137.
ERROR: Method overwriting is not permitted during Module precompilation.

So a bare using DatabentoAPI errors. The test suite (and CI) stayed green because Pkg.test falls back to running without precompilation when precompile fails, masking the problem.

Fix

Remove the second (duplicate) definition. The two were byte-identical, so there is no behavior change. The package now precompiles cleanly:

julia +release --project=. -e 'using DatabentoAPI; println("loaded OK")'
  4334.7 ms  ✓ DatabentoAPI
loaded OK

🤖 Generated with Claude Code

src/store.jl defined _foreach_typed_tolerant twice — an identical copy-paste
of the function and its doc comment. On Julia 1.12+ this fails module
precompilation ("Method overwriting is not permitted during Module
precompilation"), so a bare `using DatabentoAPI` errors. Pkg.test masks it by
falling back to no-precompile, which is why the test suite (and CI) stayed
green while the duplicate was present.

Removed the second copy; the package now precompiles cleanly. No behavior
change — the two definitions were byte-identical.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tbeason tbeason merged commit 7a1d4ff into main Jun 22, 2026
8 checks passed
@tbeason tbeason deleted the fix-precompile-method-dup branch June 22, 2026 16:52
@tbeason tbeason mentioned this pull request Jun 22, 2026
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.

1 participant