https://issues.dlang.org/show_bug.cgi?id=19808

--- Comment #5 from David Eckardt <[email protected]> ---
> I don't know what would happen if you called toISOExtString at
> compile-time. I'd have to test it. It might not even work due to using a
> pointer comparison.

I tried it:

import std.datetime.systime: SysTime;
import std.datetime.timezone: UTC;
pragma(msg, SysTime.fromUnixTime(0, UTC()).toISOExtString());

fails with “typecons.d(2145): Error: reinterpretation through overlapped field
`stripped` is not allowed in CTFE”.

Consider SysTime.fromUnixTime(0, LocalTime()) at compile-time: The `is`
comparison` could really cause a bug here, using UTC instead. However,

static immutable ctfe = SysTime.fromUnixTime(0, LocalTime());

fails with “concurrency.d(2488): Error: static variable `lock` cannot be read
at compile time”. So we are safe.

--

Reply via email to