www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6540] New: Default struct constructor problem

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6540

           Summary: Default struct constructor problem
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



I don't understand what's happening here, but I think there is something wrong:


struct V3 {
    double[3] v;
    void foo() {
        auto v2 = v[] / 2;
        V3 r = V3(v2); // line 5
    }
}
void main() {}


DMD 2.055beta gives:

test.d(5): Error: cannot implicitly convert expression (v2) of type double[] to
double

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 20 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6540


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



05:55:38 PST ---
The error is now:

Error: cannot implicitly convert expression (v2) of type double[] to double[3u]

But this seems normal to me.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6540




05:57:00 PST ---

 The error is now:
 
 Error: cannot implicitly convert expression (v2) of type double[] to double[3u]
 
 But this seems normal to me.
Edit: This is in git-head, forgot to mention. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 09 2013