← Back to index
|
Original Bugzilla link
Bug 7777 – std.typecons.Typedef problem with global arrays
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-03-25T13:03:53Z
Last change time
2020-03-21T03:56:42Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2012-03-25T13:03:53Z
This D2 code compiles with -d: typedef double[3] V3; V3 v1 = [30, 30, -50]; void main() { V3 v2 = [30, 30, -50]; } But this: import std.typecons: Typedef; alias Typedef!(double[3]) V3; V3 v1 = [30, 30, -50]; // error V3 v2 = V3([30, 30, -50]); // OK void main() { V3 v3 = [30, 30, -50]; // OK V3 v4 = V3([30, 30, -50]); // OK } with DMD 2.059head gives: test.d(3): Error: cannot use array to initialize Typedef!(double[3u],[nan,nan,nan])