---
void main() @safe
{
import std.datetime;
auto a = UTC();
auto b = UTC();
assert(a == b);
}
---
Expected result: the program compiles and runs. The assertion passes.
Actual result: tzcomp.d(6): Error: @safe function D main cannot call @system function object.opEquals
I worked around this problem by adding a @trusted function that just checks whether a timezone is equal to UTC.
This is a part of the general trend that Object.equals isn't inout, but no fix for that is likely to come soon.
Comment #1 by robert.schadek — 2024-12-01T16:33:19Z