From 168224cfde807a2d1628c5a6533ba954352f3c1f Mon Sep 17 00:00:00 2001 From: Conor Bronsdon <120674402+conorbronsdon@users.noreply.github.com> Date: Fri, 31 Jul 2026 14:29:40 -0700 Subject: [PATCH] Replace the removed String.write static call with the String constructor 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: test/test_errors.mojo:15:18: 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 arguments, and Error conforms to Writable, so String(e) is the direct replacement and produces the same bytes. Nothing in src/ used the old form; this is test-only. Co-Authored-By: Claude Opus 5 (1M context) --- test/test_date.mojo | 2 +- test/test_errors.mojo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_date.mojo b/test/test_date.mojo index e51bd2a..edf695b 100644 --- a/test/test_date.mojo +++ b/test/test_date.mojo @@ -64,7 +64,7 @@ def test_epoch() raises: def test_writable_roundtrip() raises: var d = parse_date("2026-07-03T01:02:03-07:00") - assert_equal(String.write(d), "2026-07-03T01:02:03-07:00") + assert_equal(String(d), "2026-07-03T01:02:03-07:00") def test_item_date_method() raises: diff --git a/test/test_errors.mojo b/test/test_errors.mojo index fe0944d..4d622df 100644 --- a/test/test_errors.mojo +++ b/test/test_errors.mojo @@ -12,7 +12,7 @@ def _assert_lc(source: String, offset: Int, line: Int, col: Int) raises: def _msg(e: Error) -> String: - return String.write(e) + return String(e) # --------------------------------------------------------------------------