Support Elixir 1.20#47
Open
BobbieBarker wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #47 +/- ##
==========================================
+ Coverage 83.49% 83.81% +0.32%
==========================================
Files 23 23
Lines 636 655 +19
==========================================
+ Hits 531 549 +18
- Misses 105 106 +1 ☔ View full report in Codecov by Harness. |
Add Elixir 1.20 compatibility and clear the new compiler/type-system
warnings under `--warnings-as-errors`:
- Cache.__using__: emit a single adapter_options!/1 clause per adapter
shape so the catch-all is never a dead clause, and drop the now-dead
`{:error, _}` branches in generated get/1 (handle_adapter_result is
typed to never return an error for non-erroring adapters).
- Cache.ETS: remove module-level `require Cache.OTPVersion` (only used
inside __using__, which requires it itself).
- mix.exs: move :preferred_cli_env into `def cli`, bump elixir to ~> 1.15.
Update the test toolchain for 1.20:
- Bump :credo 1.7.13 -> 1.7.18; 1.7.13 crashes on 1.20's new sigil token
format. The newer Credo surfaced one expensive `length/1 > 0` check,
rewritten as `!== []`.
- Drop the unmaintained :faker test dependency, which fails to compile on
1.20 (raw U+0085 byte is now a hard syntax error). It was only used for
three random-string helpers; replaced with a small test/support module.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
853ebee to
7f28add
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds Elixir 1.20 support and clears the new compiler/type-system warnings so the project builds clean under
--warnings-as-errors.Changes
Cache.__using__macro — 1.20's type checker flagged two patterns in the generated code:adapter_options!/1emitted an unconditional catch-all that became dead whenever a shape-specific clause was generated. Now emits exactly one clause per compile-time adapter-opts shape.get/1had a{:error, _}clause that 1.20 proves unreachable for adapters whosegetcan't error. Replaced with a catch-all that still passes errors through unchanged for adapters that can (e.g. Redis). Behavior is identical.Cache.ETS— removed the module-levelrequire Cache.OTPVersion(unused; the macro call sites live inside__using__, which requires it itself).mix.exs— moved:preferred_cli_envintodef cli(the old form is deprecated in 1.20); bumped the Elixir floor to~> 1.15.:fakertest dependency. It no longer compiles on 1.20 — a raw U+0085 byte in its source is now a hard syntax error, and the project is unmaintained. It was only used for three random-string helpers, now replaced by a smalltest/support/gen.ex.Testing
mix testpasses under 1.20 (full suite green with the CI Redis service).🤖 Generated with Claude Code