Bug 6746 – static this() inside struct skipped upon static method call

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2011-09-30T09:40:00Z
Last change time
2015-06-09T05:14:50Z
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2011-09-30T09:40:03Z
A good example is given by core.time itself. Consider. import core.time; static this() { auto t = TickDuration.from!"msecs"(100); } void main(){} This code aborts with a division by zero error. Apparently the call to the static method TickDuration.from is allowed without the @trusted shared static this() being called.
Comment #1 by bugzilla — 2011-09-30T20:23:18Z