Bug 6642 – SysTime should not be hasUnsharedAliasing

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-09-10T07:13:00Z
Last change time
2012-06-04T01:46:30Z
Assigned to
nobody
Creator
zan77137

Comments

Comment #0 by zan77137 — 2011-09-10T07:13:19Z
This code should work: ------------------------------ import core.time; import std.traits, std.datetime; static assert(!hasUnsharedAliasing!Duration); static assert(!hasUnsharedAliasing!TickDuration); static assert(!hasUnsharedAliasing!Date); static assert(!hasUnsharedAliasing!TimeOfDay); static assert(!hasUnsharedAliasing!DateTime); static assert(!hasUnsharedAliasing!SysTime); void main() {} ------------------------------ $ dmd -run main main.d(9): Error: static assert (!true) is false
Comment #1 by issues.dlang — 2011-09-10T16:07:21Z
I would assume that the problem is that std.traits.hasUnsharedAliasing can't properly handle SysTime's _timezone member variable (which is Rebindable!(immutable TimeZone)). Glancing at hasUnsharedAliasing, I would guess that hasUnsharedObjects needs to be fixed to take Rebindable into account.
Comment #2 by zan77137 — 2011-12-05T06:44:20Z
Comment #3 by lovelydear — 2012-04-27T14:49:19Z
Compiles and runs fine with 2.059 Win32