www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4950] New: Compiler fails an assert and crash when declaring a inmutable array of structs with a Variant[string] member

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

           Summary: Compiler fails an assert and crash when declaring a
                    inmutable array of structs with a Variant[string]
                    member
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: juanjux gmail.com


--- Comment #0 from Juanjo Alvarez <juanjux gmail.com> 2010-09-27 12:40:23 PDT
---
This crash the compiler:

import std.variant;

alias string function() TestFunc;

struct Crashy
{
    Variant[string] variantmember;

    this(Variant[string] m) {
        variantmember = m;
    }
}

void get_something() {
    immutable Crashy[] blah = [ Crashy(["one": Variant(1)]) ];
}

I don't know if it is correct D2, but the compiler bails out with:

dmd: expression.c:816: void expToCBuffer(OutBuffer*, HdrGenState*, Expression*,
PREC): Assertion `precedence[e->op] != PREC_zero' failed.

Removing the immutable works.

Using DMD 2.049

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 27 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4950


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
                 CC|                            |clugdbug yahoo.com.au


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-09-27 13:20:11 PDT ---
A duplicate of bug 4926, I think.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 27 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4950


Juanjo Alvarez <juanjux gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #2 from Juanjo Alvarez <juanjux gmail.com> 2010-09-27 13:25:54 PDT
---
(In reply to comment #1)
 A duplicate of bug 4926, I think.
Looks like it is, indeed, I'll resubmit once 4926 is fixed if this still happens. *** This issue has been marked as a duplicate of issue 4926 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 27 2010