Skip to content

Two of those four sorts were still the old ones - #4

Merged
martin-k-m merged 1 commit into
mainfrom
fix/one-definition-each
Sep 3, 2026
Merged

martin-k-m merged 1 commit into
mainfrom
fix/one-definition-each

Conversation

@martin-k-m

Copy link
Copy Markdown
Collaborator

#3 said four insertion sorts became four calls. Two of them did.

sort_strs and sort_deps got their one-line replacements added above the old bodies, which stayed. twill takes the last definition of a name, so both files defined the function twice and both kept running the insertion sort.

Everything passed — the tests, the source gate, CI — because nothing in any of them looks at whether a name is defined twice. lockfile.sort_entries and resolve.sort_versions were converted properly.

This deletes the 42 lines that were still doing the work, and one orphaned comment line left behind by the body it described.

Verified the way it should have been the first time: grep -c '^fn sort_strs' is 1, grep -c '^fn sort_deps' is 1, six suites pass.

The language observation is worth recording separately: a redefinition is silent, and the second one wins. fn f() = "first" followed by fn f() = "second" prints second with no diagnostic from either checker.

🤖 Generated with Claude Code

The previous change replaced sort_strs and sort_deps with calls to the
builtin and left the old bodies in the same file. twill takes the last
definition of a name, so both files defined the function twice and both
kept using the insertion sort. Everything passed: the tests, the source
gate, CI. Nothing there looks at whether a name is defined twice.

So that commit's claim was wrong for half of what it claimed. lockfile and
resolve were converted properly; strutil and manifest were not, until now.

Forty lines of dead code go with them, and one orphaned comment line that
belonged to the body that is gone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@martin-k-m
martin-k-m merged commit 1c64834 into main Sep 3, 2026
2 checks passed
@martin-k-m
martin-k-m deleted the fix/one-definition-each branch September 3, 2026 04:32
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