[Issue 3488] Segfault(expression.c): enum declared with struct initializer in template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 8 10:51:31 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3488


g <sockpuppet3 at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sockpuppet3 at hotmail.com


--- Comment #1 from g <sockpuppet3 at hotmail.com> 2009-11-08 10:51:30 PST ---
also to note that this also don't works:
--

struct A{
    int n;
}
template genA(){
    enum A genA = { n:4 };
}
immutable A b = genA!();

--

but this works:

--

struct A{
    int n;
}
template genA(){
    //works with immutable
    immutable  A genA = { n:4 };
}
immutable A b = genA!();

void main(){
    //ok
    assert(b.n == 4);
}
--

-- 
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