Closed Geod24 closed 2 years ago
Using the CI to test as I don't have a Linux at hand. Added the test, should go red, will add the fix after, which is one line.
./src/ocean/text/convert/Formatter.d(468): Error: template `ocean.text.convert.Formatter_test.__unittest_L580_C1.SysTime.toString` cannot deduce function from argument types `!()(void delegate(const(char[]) e) @system)`, candidates are:
./src/ocean/text/convert/Formatter_test.d(585): `toString(W)(ref W writer)`
./src/ocean/text/convert/Formatter.d(279): Error: template instance `ocean.text.convert.Formatter.handle!(SysTime)` error instantiating
./src/ocean/text/convert/Formatter.d(137): instantiated from here: `sformat!(SysTime)`
./src/ocean/text/convert/Formatter_test.d(587): instantiated from here: `format!(SysTime)`
make: *** [/home/runner/work/ocean/ocean/build/prod/tmp/allunittests] Error 1
submodules/makd/Makd.mak:574: recipe for target '/home/runner/work/ocean/ocean/build/prod/tmp/allunittests' failed
Bingo
Before this patch, printing a SysTime would fail because we were passing a literal, which would not implicitly convert to a 'ref'.