Bug 3961 – Error with to!(somestruct)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-03-13T17:16:00Z
Last change time
2015-06-09T05:13:45Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-03-13T17:16:12Z
This code crashes dmd: import std.conv: to; struct Int { int x; } void main() { Int i = to!Int(1); }
Comment #1 by bearophile_hugs — 2010-05-22T13:27:49Z
In DMD 2.046 the situation is improved, it doesn't cause an ICE anymore. It generates an error like: conv.d(699): Error: cannot create associative array V2[K2]
Comment #2 by bugzilla — 2010-06-19T08:05:21Z
Comment #3 by bearophile_hugs — 2010-08-11T04:13:56Z
The bug is absent in 2.048