Skip to content

Fix the MarkedString hash test on Julia 1.13 - #1429

Merged
davidanthoff merged 1 commit into
mainfrom
fix-hash-test-113
Aug 21, 2026
Merged

Fix the MarkedString hash test on Julia 1.13#1429
davidanthoff merged 1 commit into
mainfrom
fix-hash-test-113

Conversation

@davidanthoff

Copy link
Copy Markdown
Member

Julia 1.13 stopped defining the generic one-arg hash(x) as hash(x, zero(UInt)). The regression test for #1381 compared exactly those two, so it now fails on 1.13 — and the comparison is false for every type there, Int included, so it says nothing about MarkedString any more.

#1381 itself was a stray one-arg Base.hash(x::MarkedString) that made hashing identity-based and broke Dict and unique. This asserts that no such method exists — which(hash, Tuple{MarkedString}) has to resolve to the generic hash(x) — which catches the original regression on every supported version. The value-based invariants next to it are unchanged.

Found while auditing the stack for Julia 1.13 readiness.

Verified: 32/32 on 1.12.7 and on 1.13.0-rc3.

🤖 Generated with Claude Code

The #1381 regression test compared `hash(x)` against `hash(x, zero(UInt))`.
Julia 1.13 stopped defining the generic one-arg `hash(x)` as
`hash(x, zero(UInt))`, so that comparison is now false for every type, `Int`
included, and says nothing about `MarkedString` any more.

What #1381 actually was is a stray one-arg `Base.hash(x::MarkedString)`, which
made hashing identity-based and broke `Dict` and `unique`. Assert that no such
method exists instead: `which(hash, Tuple{MarkedString})` has to resolve to the
generic `hash(x)`. That catches the original regression on every supported
version, and the value-based invariants around it are unchanged.

32/32 on both 1.12.7 and 1.13.0-rc3.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@davidanthoff
davidanthoff merged commit e9224bf into main Aug 21, 2026
26 checks passed
@davidanthoff
davidanthoff deleted the fix-hash-test-113 branch August 21, 2026 17: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