fix: remove redundant type checks flagged by compiler#138
Open
gilbertwong96 wants to merge 3 commits into
Open
fix: remove redundant type checks flagged by compiler#138gilbertwong96 wants to merge 3 commits into
gilbertwong96 wants to merge 3 commits into
Conversation
- Drop redundant is_atom/1 in import clause (already guarded by outer if) - Remove dead token == :eof in skip_call_args (already handled by prior clause)
- .mise.toml: erlang 27.2 -> 29.0.2, elixir 1.18.2 -> 1.20.1-otp-29 - flake.nix: beam packages erlang_27/elixir_1_18 -> erlang_29/elixir_1_20 - release.yaml: otp 27.0 -> 29.0, elixir 1.17.x -> 1.20.x - mix.lock: credo, file_system, jason - reformat test/spitfire_test.exs under 1.20 formatter
The previous pin (rev fa35a3c8 from Feb 2025) pre-dates the addition of erlang_29 and elixir_1_20 to nixpkgs, so 'nix develop' failed with 'attribute erlang_29 missing' after the toolchain bump. Pins nixpkgs to e1c1b847 (Jun 2026) which has both. narHash computed via gonix nar dump-path and verified against the prior known-good pin.
Contributor
|
Please revert the 1.20/otp29 change. The parser tests for equality against the core parser and that changes between versions so we only test against the latest version and I haven't made the updates for 1.20 yet. |
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.
The compiler emitted two warnings for checks that are always true or always false due to prior type narrowing.
In
Spitfire.Env.expand/3, the:importclause re-checkedis_atom(arg)inside awithdespite the enclosingif is_atom(arg) doalready narrowingargtoatom(). Dropped the redundant guard, matching the sibling:requireclause.In
Spitfire.skip_call_args/2, the firstcondclause (token == nil or token == :eof) already handles:eof, so the trailingtoken == :eofin the second clause compared disjoint types and was dead. Removed it.Also bumps the toolchain to Erlang 29 / Elixir 1.20:
.mise.toml,flake.nix, andrelease.yamlversions aligned (CI usesnix developand reads these automatically)mix.lockdeps (credo, file_system, jason)test/spitfire_test.exsreformatted under the 1.20 formatter