[Issue 7777] New: std.typecons.Typedef problem with global arrays
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sun Mar 25 13:03:29 PDT 2012
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=7777
           Summary: std.typecons.Typedef problem with global arrays
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2012-03-25 13:03:53 PDT ---
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])
-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
    
    
More information about the Digitalmars-d-bugs
mailing list