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

--- Comment #0 from Juanjo Alvarez <> 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:
------- You are receiving this mail because: -------

Reply via email to