Skip to content

Fix test compile: String.write is no longer a static method - #6

Merged
conorbronsdon merged 1 commit into
mainfrom
fix-string-write
Jul 31, 2026
Merged

Fix test compile: String.write is no longer a static method#6
conorbronsdon merged 1 commit into
mainfrom
fix-string-write

Conversation

@conorbronsdon

Copy link
Copy Markdown
Owner

The test workflow has been red on main since a Mojo nightly bump between 7/29 and 7/31, with no source change to cause it. The stdlib made String.write an instance method, so both overloads now take mut self and the old static call no longer resolves:

error: no matching function in call to 'write'
note: candidate not viable: value passed to mutable argument 'self' must be mutable

String.__init__ takes a variadic pack of Writable args and Error conforms to Writable, so String(e) is the direct replacement and writes the same bytes. Verified green in CI on conorbronsdon/mojo-feed#5 before replicating here.

Test-only; nothing in src/ used the static form.

Root cause, worth a separate look: the workflow installs mojo from the nightly index with --prerelease allow and no version pin, so each run resolves whatever nightly is current. That is why a frozen repo went green → red with no commits between.

🤖 Generated with Claude Code

Mojo's stdlib made String.write an instance method -- both overloads now take
`mut self` -- so the old static form no longer resolves and the test module
fails to parse. String.__init__ takes a variadic pack of Writable arguments and
Error conforms to Writable, so String(e) is the direct replacement.

Test-only; nothing in src/ used the static form.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@conorbronsdon
conorbronsdon merged commit 31823f2 into main Jul 31, 2026
1 check passed
@conorbronsdon
conorbronsdon deleted the fix-string-write branch July 31, 2026 21:37
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