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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 27 12:41:09 PDT 2010


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 at puremagic.com
        ReportedBy: juanjux at gmail.com


--- Comment #0 from Juanjo Alvarez <juanjux at 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: -------


More information about the Digitalmars-d-bugs mailing list