www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2428] New: Accessing item in enum'd array produced compiler error

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

           Summary: Accessing item in enum'd array produced compiler error
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: schveiguy yahoo.com


I found this while porting Tango to D2, and converting manifest constants to
enums.  When using the full tango file, the result was a successful compilation
and a segfault.

However, when creating the minimal case:

struct S(T)
{
    invariant(T)[] s;
}

T foo(T)(T t)
{
    enum S!(T)[] i = [{"hello"},{"world"}];
    auto x = i[0].s;
    return t;
}
void main()
{
    auto x = foo('c');
}

the following error occurs:

dmd: inline.c:569: virtual Expression*
DeclarationExp::doInline(InlineDoState*): Assertion `ie' failed.
Aborted

The segfault might be related to the inline.c error, so probably fix that. 
Then if the original error still occurs, I'll post another bug.


-- 
Oct 23 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2428


bugzilla digitalmars.com changed:

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




------- Comment #1 from bugzilla digitalmars.com  2008-12-08 00:57 -------
Fixed in DMD 2.021


-- 
Dec 07 2008